Skip to content

Generate unique IDs for centralised and decentralised systems

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

Tyrannican/chronoflake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chronoflake

Crate to generate unique 64-bit IDs in centralised or decentralised systems.

Based on the Twitter Snowflake algorithm.

Usage

use chronoflake::IdGenerator;

const MACHINE_ID: u16 = 49;
fn main() {
    // Create an ID generator using the default (Twitter) epoch
    let mut cf = IdGenerator::new(MACHINE_ID);

    // Generate a unique ID
    let id = cf.generate_id();

    // Futher processing...
}

About

Generate unique IDs for centralised and decentralised systems

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages