Skip to main content

fill_random

Function fill_random 

Source
pub fn fill_random(buf: &mut [u8])
Expand description

Fill a byte buffer with random bytes from the entropy pool.

If the pool has not accumulated ENTROPY_HIGH_WATER bytes of entropy yet, this function spins briefly, waiting for interrupt noise. It will not block indefinitely: after ~1000 spin iterations it falls through and delivers whatever randomness is available.