![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
prng_xoshiro is a constexpr-friendly pseudorandom number generator implementing the xoshiro256++ algorithm, designed by David Blackman and Sebastiano Vigna. It is intended for use in property-based tests that need reproducible pseudorandom sequences.
The generator satisfies the C++ UniformRandomBitGenerator named requirement, so it can be used with standard library distributions and algorithms that accept a URBG.
Construct a generator with a seed and call it to produce 64-bit pseudorandom values:
The generator satisfies UniformRandomBitGenerator, so it works with standard library distributions:
Arene Base also provides its own typed distributions which can be used in a similar way to the standard ones, with some additional features and limitations:
See Typed Distributions for details on Arene Base's distributions.
A single 64-bit seed is expanded into the full 256-bit internal state using the SplitMix64 generator. This ensures the internal state is never all-zero (the only disallowed state) for any seed value.
Different seeds produce different sequences. The same seed always produces the same sequence across all platforms.
prng_xoshiro is not cryptographically secure. It must not be used for security-sensitive purposes.