The github.com/decred/dcrd/crypto/rand module provides an alternative to the
standard library's math/rand, math/rand/v2, and crypto/rand packages. It
implements a package-global fast userspace CSPRNG that never errors after
initial seeding at init time with the ability to create additional PRNGs
without locking overhead if needed. In addition to providing random bytes,
the PRNG is also capable of generating cryptographically secure integers with
uniform distribution, and provides a Fisher-Yates shuffle function that can be
used to shuffle slices with random indexes.
The github.com/decred/dcrd/crypto/rand module provides an alternative to the standard library's math/rand, math/rand/v2, and crypto/rand packages. It implements a package-global fast userspace CSPRNG that never errors after initial seeding at init time with the ability to create additional PRNGs without locking overhead if needed. In addition to providing random bytes, the PRNG is also capable of generating cryptographically secure integers with uniform distribution, and provides a Fisher-Yates shuffle function that can be used to shuffle slices with random indexes.