5 #ifndef BITCOIN_TEST_UTIL_RANDOM_H 6 #define BITCOIN_TEST_UTIL_RANDOM_H 60 #endif // BITCOIN_TEST_UTIL_RANDOM_H FastRandomContext g_insecure_rand_ctx
This global and the helpers that use it are not thread-safe.
bool randbool() noexcept
Generate a random boolean.
static bool InsecureRandBool()
void SeedRandomForTest(SeedRand seed=SeedRand::SEED)
Seed the RNG for testing.
int64_t CAmount
Amount in satoshis (Can be negative)
static uint64_t InsecureRandRange(uint64_t range)
uint32_t rand32() noexcept
Generate a random 32-bit integer.
Use (and report) random seed from environment, or a (truly) random one.
static uint256 InsecureRand256()
uint64_t randbits(int bits) noexcept
Generate a random (bits)-bit integer.
uint256 rand256() noexcept
generate a random uint256.
static uint32_t InsecureRand32()
I randrange(I range) noexcept
Generate a random integer in the range [0..range), with range > 0.
static constexpr CAmount MAX_MONEY
No amount larger than this (in satoshi) is valid.
static uint64_t InsecureRandBits(int bits)
Seed with a compile time constant of zeros.
static CAmount InsecureRandMoneyAmount()