timeflake-rs

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

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
Download history 472/week @ 2024-07-28 417/week @ 2024-08-04 510/week @ 2024-08-11 439/week @ 2024-08-18 414/week @ 2024-08-25 524/week @ 2024-09-01 208/week @ 2024-09-08 508/week @ 2024-09-15 557/week @ 2024-09-22 575/week @ 2024-09-29 445/week @ 2024-10-06 519/week @ 2024-10-13 480/week @ 2024-10-20 461/week @ 2024-10-27 411/week @ 2024-11-03 531/week @ 2024-11-10

1,900 downloads per month
Used in timeflaketiny-rs

MIT license

7KB
113 lines

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());
}

Dependencies

~580KB