3#include <xrpl/beast/utility/instrumentation.h>
4#include <xrpl/beast/xor_shift_engine.h>
15#ifndef __INTELLISENSE__
20 "The Ripple default PRNG engine must return an unsigned integral type.");
26 "The Ripple default PRNG engine return must be at least 64 bits wide.");
32template <
class Engine,
class Result =
typename Engine::result_type>
65 seed = distribution(seeder);
93template <
class Engine,
class Integral>
95rand_int(Engine& engine, Integral min, Integral max)
97 XRPL_ASSERT(max > min,
"xrpl::rand_int : max over min inputs");
105template <
class Integral>
112template <
class Engine,
class Integral>
116 return rand_int(engine, Integral(0), max);
119template <
class Integral>
126template <
class Integral,
class Engine>
133template <
class Integral =
int>
143template <
class Byte,
class Engine>
146 detail::is_engine<Engine>::value,
150 return static_cast<Byte
>(rand_int<Engine, std::uint32_t>(
154template <
class Byte = std::u
int8_t>
166template <
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.