timeflake-rs

Crates.iotimeflake-rs
lib.rstimeflake-rs
version0.3.0
sourcesrc
created_at2022-04-17 06:59:33.732565
updated_at2022-10-06 08:22:21.399471
descriptionTimeflake is a 128-bit, roughly-ordered, URL-safe UUID. Inspired by Twitter's Snowflake, Instagram's ID and Firebase's PushID.
homepage
repositoryhttps://github.com/perillamint/timeflake-rs
max_upload_size
id569337
size18,438
(perillamint)

documentation

README

Timeflake-rs

Build Status crates.io License

Timeflake is a 128-bit, roughly-ordered, URL-safe UUID. Inspired by Twitter's Snowflake, Instagram's ID and Firebase's PushID.

Port of https://github.com/anthonynsimon/timeflake in pure Rust

Example code

use Timeflake;

fn main() {
    let time = SystemTime::now().duration_since(UNIX_EPOCH).unwrap();
    println!("{}", Timeflake::random().unwrap());
    println!("{}", Timeflake::from_values(time, Some(0)).unwrap());
    println!("{}", Timeflake::from_values(time, None).unwrap());
}
Commit count: 33

cargo fmt