Skip to main content

random_hex

Function random_hex 

Source
pub fn random_hex(byte_len: usize) -> String
Expand description

byte_len cryptographically-strong random bytes, hex-encoded - for anywhere a short, unpredictable, URL/filename-safe token is needed (a CSRF token, a generated upload filename) but a full uuid dependency would be overkill for. rand is already a dependency of this crate for exactly this reason.