Skip to content

relops/snowflake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

<dependency>
    <groupId>com.relops</groupId>
    <artifactId>snowflake</artifactId>
    <version>1.1</version>
</dependency>

About

Java library to generate k-ordered unique 64-bit integers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages