Skip to main content

SecureRandom

Trait SecureRandom 

Source
pub trait SecureRandom: CryptoSafe {
    // Required method
    fn fill(&self, buf: &mut [u8]) -> Result<(), CryptoError>;
}
Expand description

Secure random number generator.

Required Methods§

Source

fn fill(&self, buf: &mut [u8]) -> Result<(), CryptoError>

Fill buffer with cryptographically secure random bytes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§