Grand is a simple random generator wrapper on math/rand seeded by entropy from crypto/rand
Create a source that can be used by the randomizer. NewSource
creates a source
with an optional seed. If there is no seed provided, a truly random seed will be
derived from crypto/rand.
If a seed is provided, the function will not return an error. If entropy is used, the function can return an error if it fails to read bytes from crypto/rand
// New source using entropy
src, err := grand.NewSource()
// New source from existing seed
src, _ := grand.NewSource(1552664635341843643)
The randomizer can use any math/rand source, not only ones created using this package.
// New randomizer from source
rng := grand.New(src)