simpleflake

Crates.iosimpleflake
lib.rssimpleflake
version0.0.4
sourcesrc
created_at2014-12-29 23:50:37.582123
updated_at2015-12-15 00:03:39.936387
descriptionDistributed ID generation in Rust for the lazy.
homepage
repositoryhttps://github.com/michaelcontento/simpleflake-rs
max_upload_size
id663
size4,326
conjure-rust (github:palantir:conjure-rust)

documentation

README

simpleflake-rs

Travis Status: 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);
Commit count: 19

cargo fmt