Skip to main content

Module id

Module id 

Source
Expand description

Lightweight generation of short, unique, URL-safe identifiers.

These IDs are used purely to disambiguate things like in-flight tool calls and request headers โ€” they are not security-sensitive and do not need a cryptographic source of randomness. We therefore generate them with fastrand (already a hard dependency of this crate) rather than pulling in nanoid โ†’ rand โ†’ getrandom, which would add a cryptographic RNG (and a getrandom/js shim on wasm) for no benefit here.

Functionsยง

generate
Generate a 21-character, URL-safe, non-cryptographic identifier.
generate_with_len
Generate a len-character, URL-safe, non-cryptographic identifier.