#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

#385 in HTTP client

Download history 483/week @ 2024-03-13 515/week @ 2024-03-20 295/week @ 2024-03-27 419/week @ 2024-04-03 414/week @ 2024-04-10 413/week @ 2024-04-17 465/week @ 2024-04-24 509/week @ 2024-05-01 435/week @ 2024-05-08 499/week @ 2024-05-15 472/week @ 2024-05-22 486/week @ 2024-05-29 494/week @ 2024-06-05 616/week @ 2024-06-12 495/week @ 2024-06-19 520/week @ 2024-06-26

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

~575KB