hash_counter_engine
Synopsis
Declared in <folly/random/hash.h>
template<
typename Hash,
typename State>
class hash_counter_engine;
Description
Hashes an incrementing integer to produce a pseudo‐random output.
Pros: * Keeps minimal state.
Cons: * Randomness quality depends on the hash function. * Less performant than a dedicated random engine, even than one based on the same hash function might be.
Type Aliases
Name |
Description |
The unsigned integer type produced by the engine. |
|
The integer counter type advanced on each draw. |
Member Functions
Name |
Description |
|
Constructors |
Generates the next random value. |