chronoflake

Crates.iochronoflake
lib.rschronoflake
version1.0.1
sourcesrc
created_at2023-09-21 22:02:03.448743
updated_at2024-01-15 17:26:38.832616
descriptionGenerate unique IDs based on the Snowflake algorithm
homepagehttps://github.com/Tyrannican/chronoflake
repositoryhttps://github.com/Tyrannican/chronoflake
max_upload_size
id980111
size17,585
Graham Keenan (Tyrannican)

documentation

https://docs.rs/chronoflake

README

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...
}

Commit count: 3

cargo fmt