Documentation ¶
Overview ¶
Package cryptorand implements a mockable source or crypto strong randomness.
In real world scenario it is same source as provided by crypt/rand. In tests it is replaced with reproducible, not really random stream of bytes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns an io.Reader that emits random stream of bytes.
Usually this returns crypto/rand.Reader, but unit tests may replace it with a mock by using 'MockForTest' function.
func MockForTest ¶
MockForTest installs deterministic source of 'randomness' in the context.
Must not be used outside of tests.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.