Skip to main content

try_random_bytes

Function try_random_bytes 

Source
pub fn try_random_bytes<const N: usize>() -> Result<[u8; N], EntropyHealthError>
Expand description

Generates N bytes of mixed entropy.

For requests <= 32 bytes, returns a truncated output from random_bytes_mixed(). For larger requests, generates multiple 32-byte blocks with unique counters.

Returns an error if the RNG health check fails.