Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DurationBetween ¶ added in v0.12.0
DurationBetween generates a random duraiton in the range of [lowerLimit, upperLimit).
TODO: When we drop Go 1.21 support, switch to `math/rand/v2` and kill the `rand.Rand` argument.
func IntBetween ¶
IntBetween generates a random number in the range of [lowerLimit, upperLimit).
TODO: When we drop Go 1.21 support, switch to `math/rand/v2` and kill the `rand.Rand` argument.
func NewCryptoSeededConcurrentSafeRand ¶
NewCryptoSeededConcurrentSafeSource generates a new pseudo-random source that's been created with a cryptographically secure seed to ensure reasonable distribution of randomness between nodes and services, and wrapped so that access to it is concurrent safe.
This project uses this technique instead of falling back on crypto/rand because uses of randomness don't need to be cryptographically secure, and the non-crypto variant is about twenty times faster.
Types ¶
This section is empty.