Function rand_bytes
pub fn rand_bytes(buf: &mut [u8]) -> Result<(), ErrorStack>
Expand description
Fill buffer with cryptographically strong pseudo-random bytes.
This corresponds to RAND_bytes
.
ยงExamples
To generate a buffer with cryptographically strong bytes:
use rama_boring::rand::rand_bytes;
let mut buf = [0; 256];
rand_bytes(&mut buf).unwrap();