#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

#376 in HTTP client

Download history 50/week @ 2023-11-24 24/week @ 2023-12-01 46/week @ 2023-12-08 51/week @ 2023-12-15 1/week @ 2023-12-22 23/week @ 2024-01-26 6/week @ 2024-02-02 378/week @ 2024-02-16 489/week @ 2024-02-23 438/week @ 2024-03-01 226/week @ 2024-03-08

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

~555KB