ddn.crypto.random

Secure random number generation implementation.

alias Random

Types 2

Implementation of a cryptographically secure random number generator.

Uses the operating system's CSPRNG:

  • POSIX: /dev/urandom, read through a raw file descriptor

    with no userspace buffering, so entropy is never retained in a library buffer and fork() cannot duplicate it

  • Windows: BCryptGenRandom with the system-preferred RNG