Crates.io | tuid |
lib.rs | tuid |
version | 0.1.0-alpha.0 |
source | src |
created_at | 2021-11-20 00:59:59.082343 |
updated_at | 2024-11-28 01:24:21.480595 |
description | Sequential UUID generator |
homepage | |
repository | https://github.com/mselee/tuid/blob/master/tuid-rs |
max_upload_size | |
id | 484686 |
size | 29,199 |
Sequential UUID generator.
This generator uses a time-based component as the shared prefix. The prefix is non-monotonic, and wraps around every once in a while to achieve a dense key space.
If using cargo-edit
cargo add tuid
or add it yourself to Cargo.toml
[dependencies]
tuid = "0.1.0-alpha"
fn main() {
use rand::Rng;
let mut rng = rand::thread_rng();
let tid = tuid::gen::default(rng.gen(), rng.gen());
let uid = tid.as_uuid();
let hex = tid.as_hex();
}