class RandomGenerator
Defined at line 36 of file ../../third_party/pigweed/src/pw_random/public/pw_random/random.h
A random generator uses injected entropy to generate random values. Many of
the guarantees for this interface are provided at the level of the
implementations. In general:
* DO assume a generator will always succeed.
* DO NOT assume a generator is cryptographically secure.
* DO NOT assume uniformity of generated data.
Public Methods
void Get (ByteSpan dest)
Populates the destination buffer with a randomly generated value.
Parameters
void ~RandomGenerator ()
Defined at line 38 of file ../../third_party/pigweed/src/pw_random/public/pw_random/random.h
template <class T>
void GetInt (T & dest)
Defined at line 41 of file ../../third_party/pigweed/src/pw_random/public/pw_random/random.h
template <class T>
void GetInt (T & dest, const T & exclusive_upper_bound)
Calculates a uniformly distributed random number in the range
`[0, exclusive_upper_bound)`.
This avoids modulo biasing. Uniformity is only guaranteed if the
underlying generator generates uniform data. Uniformity is achieved by
generating new random numbers until one is generated in the desired
range (with optimizations).
Parameters
Defined at line 60 of file ../../third_party/pigweed/src/pw_random/public/pw_random/random.h
void InjectEntropy (ConstByteSpan data)
Injects entropy into the pool byte-by-byte.
Defined at line 103 of file ../../third_party/pigweed/src/pw_random/public/pw_random/random.h
void InjectEntropyBits (uint32_t data, uint_fast8_t num_bits)
Injects entropy into the pool.