Skip to main content

generate_token

Function generate_token 

Source
pub fn generate_token(length: usize) -> String
Expand description

Generate a random alphanumeric token of specified length.

Delegates to generate_secure_token internally — both use the same cryptographically secure RNG (rand::rng()). Prefer generate_secure_token in new code so callers handle errors explicitly.