You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I understood, given fixed seed, workerId, the generated ids are unique, so the only thing that decides which id to generate is the time. However, the combinations are limited, so the uniqueness could only be ensured within some time range. If I keep generating ids over that time range, I must enter another loop and get duplicated ids.
Is that right? what's the max time range this package guarantee?
The text was updated successfully, but these errors were encountered:
Not sure if this answer your concern, but by looking at the codes, seems like you need to do this every year to keep the uniqueness?
// Ignore all milliseconds before a certain time to reduce the size of the date entropy without sacrificing uniqueness.
// This number should be updated every year or so to keep the generated id short.
// To regenerate `new Date() - 0` and bump the version. Always bump the version!
var REDUCE_TIME = 1459707606518;
As I understood, given fixed seed, workerId, the generated ids are unique, so the only thing that decides which id to generate is the time. However, the combinations are limited, so the uniqueness could only be ensured within some time range. If I keep generating ids over that time range, I must enter another loop and get duplicated ids.
Is that right? what's the max time range this package guarantee?
The text was updated successfully, but these errors were encountered: