https://github.com/relops/snowflake
Java library to generate k-ordered unique 64-bit integers.
https://github.com/relops/snowflake
Last synced: 11 days ago
JSON representation
Java library to generate k-ordered unique 64-bit integers.
- Host: GitHub
- URL: https://github.com/relops/snowflake
- Owner: relops
- License: mit
- Created: 2014-05-08T15:59:12.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-05-08T21:56:34.000Z (over 11 years ago)
- Last Synced: 2025-07-30T00:57:24.535Z (5 months ago)
- Language: Java
- Homepage:
- Size: 172 KB
- Stars: 114
- Watchers: 7
- Forks: 34
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-java - Snowflake
README
# Snowflake
A snowflake is a source of k-ordered unique 64-bit integers.
This is a Java library for generating ids in an un-coordinated setting:
int node = 1;
Snowflake s = new Snowflake(node);
long id = s.next();
The node id is a manually assigned value between 0 and 1023 which is
used to differentiate different snowflakes when used in a multi-node cluster.
To include this as a library, you can use the following Maven dependency:
com.relops
snowflake
1.1