[][src]Module sodiumoxide::randombytes

Cryptographic random number generation.

Functions

randombytes

randombytes() randomly generates size bytes of data.

randombytes_into

randombytes_into() fills a buffer buf with random data.

randombytes_uniform

randombytes_uniform() returns an unpredictable value between 0 and upper_bound (excluded). It guarantees a uniform distribution of the possible output values even when upper_bound is not a power of 2. Note that an upper_bound < 2 leaves only a single element to be chosen, namely 0.