Skip to main content

random_bytes

Function random_bytes 

Source
pub fn random_bytes(len: usize) -> Result<Vec<u8>, CryptoError>
Expand description

Allocate and fill a Vec<u8> with len cryptographically secure random bytes.

Returns CryptoError::Rng if the OS random source is unavailable.