#timeflake #timeflake-rs

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 492/week @ 2024-12-15 199/week @ 2024-12-22 337/week @ 2024-12-29 480/week @ 2025-01-05 640/week @ 2025-01-12 531/week @ 2025-01-19 382/week @ 2025-01-26 177/week @ 2025-02-02 291/week @ 2025-02-09 384/week @ 2025-02-16 217/week @ 2025-02-23 188/week @ 2025-03-02 250/week @ 2025-03-09 198/week @ 2025-03-16 71/week @ 2025-03-23 397/week @ 2025-03-30

917 downloads per month
Used in 2 crates

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

~610KB
~10K SLoC