lid (Lily's ID)
MSRV: 1.60.0
I wanted something that I could trust with being unique enough, while also being extremely fast and light on system resources.
My initial usecase for this was an ID that was unique and could be generated by multiple services without worry, I didn't need it to be unguessable, though you can configure it to fit a need where you don't want people guessing IDs.
By default, this uses the Base36 Alphabet with 16 prefix bytes and 12 sequence bytes. This gives (36^28) possible IDs.
Example usage
use ;
Benchmarks
CPU: 7950X3D
LID w/ 12 prefix, 8 sequence, min incr=100, max incr=1000
time: [13.656 ns 13.707 ns 13.783 ns]
LID w/ 16 prefix, 12 sequence, min incr=100, max incr=1000
time: [17.138 ns 17.208 ns 17.328 ns]
LID w/ 12 prefix, 8 sequence, min incr=50_000, max incr=5_000_000
time: [13.781 ns 13.860 ns 13.964 ns]
LID w/ 16 prefix, 12 sequence, min incr=50_000, max incr=5_000_000
time: [15.851 ns 15.886 ns 15.921 ns]
colorid w/ 20 bytes time: [405.33 ns 406.75 ns 408.38 ns]
colorid w/ 28 bytes time: [508.13 ns 508.84 ns 509.60 ns]
nanoid::nanoid!() time: [342.53 ns 343.13 ns 343.74 ns]
nanoid::nanoid!(28) time: [366.67 ns 366.89 ns 367.12 ns]