#uuid #timeflake #random #timeflake-rs

no-std timeflake

Rust port of Timeflake, a 128-bit, roughly-ordered, URL-safe UUID

1 unstable release

Uses new Rust 2024

new 0.1.0 Mar 30, 2025

#65 in #uuid

MIT license

30KB
447 lines

Actions crates.io version

timeflake-rs

Rust port of Timeflake, a 128-bit, roughly-ordered, URL-safe UUID.

Original work can be found at anthonynsimon/timeflake.

Usage

[dependencies]
timeflake = "0.1.0"

or

cargo add timeflake

Example

use timeflake::Timeflake;

fn main() {
    let mut rng = rand::rng();
    let flake = Timeflake::new_random(&mut rng);
    println!("{flake}");
}

Features

  • std: Allow no_std environments. This is on by default.
  • uuid: Allow use of uuid crate. This is on by default.

Benchmark

Run benchmarks by follow command. It is recommended to have gnuplot installed.

cargo bench

Dependencies

~2–11MB
~129K SLoC