Expand description
Rust port of Timeflake, a 128-bit, roughly-ordered, URL-safe UUID.
§Usage
[dependencies]
timeflake = "0.1.0"
use timeflake::Timeflake;
fn main() {
let mut rng = rand::rng();
let flake = Timeflake::new_random(&mut rng);
println!("{flake}");
}
Modules§
Structs§
- Timeflake
- Represents a Timeflake, a unique identifier combining timestamp and random data.
Constants§
- BASE62
- The Base62 character set used for encoding and decoding Timeflakes.
- HEX
- The hexadecimal character set used for encoding Timeflakes as hexadecimal strings.
- MAX_
RANDOM - The maximum possible random component in a Timeflake.
- MAX_
TIMEFLAKE - The maximum possible integer value of a Timeflake.
- MAX_
TIMESTAMP - The maximum possible timestamp component in a Timeflake.
Functions§
- max_
random_ biguint - Reinterpret the MAX_RANDOM as a BigUint
- max_
timeflake_ biguint - Reinterpret the MAX_TIMEFLAKE as a BigUint