id-gnrt-rust-impl

Crates.ioid-gnrt-rust-impl
lib.rsid-gnrt-rust-impl
version0.1.0
created_at2025-09-06 08:08:52.209618+00
updated_at2025-09-06 08:08:52.209618+00
descriptionA fast, thread-safe Rust implementation of the Snowflake ID generator algorithm.
homepagehttps://github.com/NalinDalal/snowflake-rs
repositoryhttps://github.com/NalinDalal/snowflake-rs
max_upload_size
id1826873
size9,741
Nalin Dalal (NalinDalal)

documentation

https://docs.rs/id-gnrt-rust-impl

README

id-gnrt-rust-impl

A Rust implementation of the Snowflake ID generator algorithm. This project provides a fast, thread-safe way to generate unique, time-ordered 64-bit IDs, inspired by Twitter's Snowflake.

Features

  • Generates unique 64-bit IDs based on timestamp, datacenter, machine, and sequence.
  • Thread-safe and efficient.
  • Custom epoch for compact IDs.

Usage

Add this crate to your Cargo.toml:

[dependencies]
id-gnrt-rust-impl = "0.1.0"

Example usage:

use id_gnrt_rust_impl::Snowflake;

let generator = Snowflake::new(1, 1);
let id = generator.next_id();
println!("Generated ID: {}", id);

License

MIT

Commit count: 9

cargo fmt