Documentation ¶
Overview ¶
Package fastrand implements a cryptographically secure pseudorandom number generator. The generator is seeded using the system's default entropy source, and thereafter produces random values via repeated hashing. As a result, fastrand can generate randomness much faster than crypto/rand, and generation cannot fail beyond a potential panic at init.
The method used in this package is similar to the Fortuna algorithm, which is used in used in FreeBSD for /dev/urandom. This package uses techniques that are known to be secure, however the exact implementation has not been heavily reviewed by cryptographers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Reader *randReader
Reader is a global, shared instance of a cryptographically strong pseudo- random generator. It uses blake2b as its hashing function. Reader is safe for concurrent use by multiple goroutines.
Functions ¶
func Read ¶
func Read(b []byte)
Read is a helper function that calls Reader.Read on b. It always fills b completely.
Types ¶
This section is empty.