#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

#405 in HTTP client

Download history 503/week @ 2024-08-31 223/week @ 2024-09-07 491/week @ 2024-09-14 579/week @ 2024-09-21 557/week @ 2024-09-28 453/week @ 2024-10-05 516/week @ 2024-10-12 479/week @ 2024-10-19 464/week @ 2024-10-26 404/week @ 2024-11-02 549/week @ 2024-11-09 571/week @ 2024-11-16 492/week @ 2024-11-23 623/week @ 2024-11-30 576/week @ 2024-12-07 492/week @ 2024-12-14

2,311 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

~580KB