Function openssl::rand::rand_bytes
source · [−]Expand description
Fill buffer with cryptographically strong pseudo-random bytes.
Examples
To generate a buffer with cryptographically strong random bytes:
use openssl::rand::rand_bytes;
let mut buf = [0; 256];
rand_bytes(&mut buf).unwrap();
This corresponds to RAND_bytes
.