GetRandBytes

Generate random data via the internal PRNG.

Synopsis

Declared in <random.h>

void
GetRandBytes(std::span<unsigned char> bytes) noexcept;

Description

These functions are designed to be fast (sub microsecond), but do not necessarily meaningfully add entropy to the PRNG state.

In test mode (see SeedRandomForTest in src/test/util/random.h), the normal PRNG state is bypassed, and a deterministic, seeded, PRNG is used instead.

Thread-safe.

Parameters

NameDescription
bytesThe output buffer to fill with random data.