cuid2-timeless
An unstable, barely tested, probably giving wrong output and might panic out of nowhere CUID2 implementation in Rust. Built for learning more rust and I don't know how to test it.
[!CAUTION] This library is slower than cuid-rust by a whole lot!
benchmark cuid2-timeless cuid2 (cuid-rust) single cuid generation 53.180 µs 2.8162 µs 10,000 cuids generation 553.52 ms 28.900 ms This library is for learning purposes. Please don't use this library in production! Use cuid-rust instead!
Installation
cargo add cuid2_timeless --features sha3 (or you can use sha2 if you wanted to)
Usage
Either use the cuid2_timeless::cuid_wrapper() and call it again to get ID or get some customization with cuid2_timeless::Cuid
use cuid2_timeless;
let mut cuid = cuid_wrapper;
println!;
or some customization
use cuid2_timeless;
use ;
let mut cuid = new;
cuid.generate.unwrap;
or verify if it actually is CUID
use cuid2_timeless;
println!;
Features
regexis a feature for either remove or addregexcrate to the module. Turning this off will remove theis_cuidfunction (enabled by default)randomis a feature for either remove or addrandcrate to the module. Turning this off will removeDefaulttrait fromCuid(enabled by default)sha2is a feature for either remove or addsha2crate to the module. Turning this off will remove SHA2 hashing algorithm, but turning this feature on will usessha2for hashing (cannot enabled withsha3present, compiling will error ifsha2andsha3is enabled, not enabled by default)sha3is a feature for either remove or addsha3crate to the module. Turning this off will remove SHA3 hashing algorithm, but turning this feature on will usessha3for hashing (cannot enabled withsha2present, compiling will error ifsha2andsha3is enabled, enabled by default)