Skip to content

Prng32

Description

Lower 32 / 16 / 8 bits of the next sample. Faster at the call site than masking Prng64 by hand; the underlying state is the same so each call still consumes one position in the PRNG sequence.

Success

Returns the truncated low bits of the next sample (32 / 16 / 8 bits respectively). The shared PRNG state advances by one position per call.

Failure

Aborts via LOG_FATAL on first PRNG use if the OS entropy source is unavailable (same fatal-on-bad-OS contract as Prng64; no safe fallback exists).

Usage example (Cross-references)

Usage examples (Cross-references)
        return prng_internal();
    }
    u32 Prng32(void) {
        return (u32)prng_internal();
    }
Last updated on