Documentation
¶
Overview ¶
Package random helps seed the math/rand pseudo-random number generator.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SecureInt64 ¶
func SecureInt64() int64
SecureInt64 returns 64 bits of randomness from crypto/rand. It panics if crypto/rand returns an error. This is useful for passing into math/rand.
func SeedMath ¶
func SeedMath()
SeedMath seeds the global math/rand pseudo-random number generator with a crypto/rand input. It panics if crypto/rand returns an error.
This should be called before using math/rand, which is otherwise seeded with the value 1. It's safe to call this multiple times, and doing so should produce no observable effects. However, it should not be called often for performance reasons.
Note: this does not make the math/rand output secure for cryptographic purposes, but it does make the math/rand output more useful for things like load balancing and randomized algorithms.
Types ¶
This section is empty.