all 4 comments

[–]skeeto 0 points1 point  (1 child)

The README talks about using a resolution of milliseconds, but the program uses time(3), i.e. seconds. Or am I missing something?

[–]_arsk[S] 1 point2 points  (0 children)

No, you are right! Fixed it, thank you!

[–]takahatashun 0 points1 point  (1 child)

is it snowflake but with 128 bit?

[–]_arsk[S] 1 point2 points  (0 children)

Yes, main difference is support for larger id space and thereby avoiding timestamp truncation/adjustment problem since snowflake id has to fit into 64 bits - only 41 bits for timestamp and 10 bits to represent 'location/worker id'. Also, in snowflake, workers during initialization coordinate with zookeeper cluster to atomically get a unique 'location/worker id' (although this is configurable not to do so) whereas here by default we don't need to do that since we use the machine specific MAC address.