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

Name

Description

bytes

The output buffer to fill with random data.

Created with MrDocs