sonyflake
sonyflake copied to clipboard
A distributed unique ID generator inspired by Twitter's Snowflake
For build systems, unit tests, research, and a range of other contexts it is useful to be able to generate reproducible IDs. Similar to controlling the random seed of a...
### Description: This pull request addresses issue #39. ### Task items: 1. define `startTimeMono` variable 2. Add `NextIDMono,currentElapsedTimeMono` function 3. Update test case
Add `Use64Bits` to Settings. When true, the bit length used for time will be 40 instead of 39. This allows for the generation of unique IDs for over 348 years...
In some scenarios, it is necessary to generate an ID in the past, hoping to support this function. thx!
in this scenario, NextID() could block very long time. 1. in a high load: `(sf.sequence + 1) & maskSequence == 0` 2. in the same time, system clock drift backwards,...
I'd like to use this code in an AWS Lambda. Is it possible to get a unique 16 bit id for the lambda instance it is running in? The equivalent...
an error occurred when I new Sonyflake. the file is github.com/sony/[email protected]/sonyflake.go. i'm use MacOs 14.4.1. After debugging, I found that the isPrivateIPv4() check ip error under lower16BitPrivateIP() method. i not...
I'm having a trouble integrating sonyflake into my project. sonyflake only generates int64. unfortunately int64 is not officially supported by javascript or lua. there will be a precision lost. If...