3#include <xrpl/beast/utility/instrumentation.h>
4#include <xrpl/beast/xor_shift_engine.h>
15#ifndef __INTELLISENSE__
19 "The Ripple default PRNG engine must return an unsigned integral type.");
23 "The Ripple default PRNG engine return must be at least 64 bits wide.");
29template <
class Engine,
class Result =
typename Engine::result_type>
62 seed = distribution(seeder);
90template <
class Engine,
class Integral>
92rand_int(Engine& engine, Integral min, Integral max)
94 XRPL_ASSERT(max > min,
"xrpl::rand_int : max over min inputs");
102template <
class Integral>
109template <
class Engine,
class Integral>
113 return rand_int(engine, Integral(0), max);
116template <
class Integral>
123template <
class Integral,
class Engine>
130template <
class Integral =
int>
140template <
class Byte,
class Engine>
143 detail::is_engine<Engine>::value,
147 return static_cast<Byte
>(
151template <
class Byte = std::u
int8_t>
161template <
class Engine>
detail::xor_shift_engine<> xor_shift_engine
XOR-shift Generator.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::enable_if_t<(std::is_same< Byte, unsigned char >::value||std::is_same< Byte, std::uint8_t >::value), Byte > rand_byte()
std::enable_if_t< std::is_integral< Integral >::value, Integral > rand_int()
beast::xor_shift_engine & default_prng()
Return the default random engine.