Skip to content

Distributed ID generation in Rust for the lazy.

License

Notifications You must be signed in to change notification settings

anixe/simpleflake-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simpleflake-rs

Forked from the archived repository michaelcontento/simpleflake-rs.

Distributed ID generation in rust for the lazy. Based on the python implementation from [SawdustSoftware][].

Installation

Just add this crate as a dependency to your Cargo.toml:

[dependencies.simpleflake]
git = "https://github.com/anixe/simpleflake-rs"

Usage

extern crate simpleflake;

let new_id = simpleflake::new();
println!("generated id: {}", new_id);

let parts = simpleflake::parse(new_id);
println!("timestamp: {}", parts.timestamp);
println!("random bits: {}", parts.random_bits);

About

Distributed ID generation in Rust for the lazy.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%