fauxflake
fauxflake copied to clipboard
Fauxflake is an easily embeddable, decentralized, k-ordered unique ID generator.
Ensure sequence number is appropriately masked to prevent it clobbering machine id
I was a bit surprised to see that this code in a unit test produces two duplicates: ``` IdGenerator snowflake = IdGenerators.newSnowflakeIdGenerator(); for (int i = 0; i < 10;...
Fix #5
Use absolute value of machine ID. Parameterize SnowflakeDecodingUtilsTest to try positive & negative values.
Negative machine IDs are possible, and SnowflakeEncodingProvider left-shifts these without checking, resulting in a small negative number that is OR'ed with the timestamp, erasing the timestamp. Example: ``` static class...
For some reason whenever I run an application using fauxflake inside a docker, it always generates the same id (this is a single long running instance of a linux container),...
The top most bit of the first Vendor byte is causing negative MAC addressed and hence negative flakes. I suggest removing the least significant bit of first vendor byte, the...
The top most bit of the first Vendor byte is causing negative MAC addressed and hence negative flakes. I suggest removing the least significant bit of first vendor byte, the...