#url-safe #uuid #snowflake #twitter #id #instagram #timeflake

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

#438 in HTTP client

Download history 571/week @ 2024-11-16 492/week @ 2024-11-23 623/week @ 2024-11-30 576/week @ 2024-12-07 493/week @ 2024-12-14 218/week @ 2024-12-21 322/week @ 2024-12-28 481/week @ 2025-01-04 649/week @ 2025-01-11 518/week @ 2025-01-18 404/week @ 2025-01-25 177/week @ 2025-02-01 285/week @ 2025-02-08 390/week @ 2025-02-15 218/week @ 2025-02-22 180/week @ 2025-03-01

1,094 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

~615KB
~10K SLoC