# File lib/ruote/id/mnemo_wfid_generator.rb, line 45 def generate t = Time.now.utc time = t.strftime('%Y%m%d-%H%M') ms = t.to_f % 60.0 #c = @mutex.synchronize { @counter = (@counter + 1) % 100_000 } @counter = (@counter + 1) % 100_000 # # no need to worry about skipping a beat, no mutex. s = "#{ms}!#{Thread.current.object_id}!#{@here}!#{@counter}" s = Digest::MD5.hexdigest(s) x = Rufus::Mnemo.from_i(s[0, 6].to_i(16)) y = Rufus::Mnemo.from_i(s[6, 6].to_i(16)) "#{time}-#{x}-#{y}" end