Skip to main content

get_random_bytes

Function get_random_bytes 

Source
pub fn get_random_bytes(n_bytes: usize) -> Vec<u8> 
Expand description

Collect n_bytes of SHA-256 conditioned entropy from all available browser sources.

Combines timing jitter and crypto.getRandomValues() into a SHA-256 conditioned output stream. This is the recommended entry point for applications that need high-quality random bytes.