7 releases
0.3.0 | Oct 6, 2022 |
---|---|
0.2.4 | Aug 4, 2022 |
0.2.2 | Apr 18, 2022 |
0.1.0 | Apr 17, 2022 |
1,900 downloads per month
Used in timeflaketiny-rs
7KB
113 lines
Timeflake-rs
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());
}
Dependencies
~580KB