Crates.io | timeflake-rs |
lib.rs | timeflake-rs |
version | 0.3.0 |
source | src |
created_at | 2022-04-17 06:59:33.732565 |
updated_at | 2022-10-06 08:22:21.399471 |
description | Timeflake is a 128-bit, roughly-ordered, URL-safe UUID. Inspired by Twitter's Snowflake, Instagram's ID and Firebase's PushID. |
homepage | |
repository | https://github.com/perillamint/timeflake-rs |
max_upload_size | |
id | 569337 |
size | 18,438 |
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
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());
}