JavaScript implementation of Twitter Snowflake ID Generator
For high availability within and across data centers, machines generating ids should not have to coordinate with each other.
- id (64 bits) is composed of:
- time - 42 bits (millisecond precision w/ a custom epoch)
- configured machine id - 10 bits - up to 1024 machines
- sequence number - 12 bits - up to 4096 random numbers
You should use NTP to keep your system clock accurate.
Check Demo