openssl

Module rand

source
Expand description

Utilities for secure random number generation.

§Examples

To generate a buffer with cryptographically strong bytes:

use openssl::rand::rand_bytes;

let mut buf = [0; 256];
rand_bytes(&mut buf).unwrap();

Functions§

  • Controls random device file descriptor behavior.
  • Fill buffer with cryptographically strong pseudo-random bytes.
  • Fill buffer with cryptographically strong pseudo-random bytes. It is intended to be used for generating values that should remain private.