pub fn random(length: usize) -> StringExpand description
Generates a random string of length letters and digits.
let token = laravel::str::random(40);
assert_eq!(token.len(), 40);
assert!(token.chars().all(|c| c.is_ascii_alphanumeric()));§Panics
Panics when the operating system can’t provide random bytes.