#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

#379 in HTTP client

Download history 4/week @ 2023-12-21 23/week @ 2024-01-25 3/week @ 2024-02-01 3/week @ 2024-02-08 284/week @ 2024-02-15 488/week @ 2024-02-22 450/week @ 2024-02-29 471/week @ 2024-03-07 501/week @ 2024-03-14 480/week @ 2024-03-21 336/week @ 2024-03-28 353/week @ 2024-04-04

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

~560KB