Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Distributed ID generation in Rust for the lazy.

License

Notifications You must be signed in to change notification settings

michaelcontento/simpleflake-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simpleflake-rs

Build Status

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

You can read an overview of what this does and why it came into being at the Sawdust Software Blog.

Installation

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

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

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