1 2 3 4 5 6 7 8
//! Secure random values. /// 32 random bytes from the OS, hex-encoded. pub fn token() -> String { let mut bytes = [0u8; 32]; getrandom::fill(&mut bytes).expect("the OS random number generator failed"); bytes.iter().map(|b| format!("{b:02x}")).collect() }