Commit graph

3 commits

Author SHA1 Message Date
Eric Windisch
8a44179788 Prefer crypto rand seed for pkg/rand
Crypto rand is a much better seed for math/rand than
time. In the event we use math/rand where we should not,
this will make it a safer source of random numbers.

Although potentially dangerous, this will still fallback
to time should crypto/rand for any reason fail.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-07-29 12:55:57 -04:00
Alexander Morozov
fb13942b1e Add global instance of *(math/rand).Rand and Reader
You can read random bytes from Reader without exhausting entropy.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-28 22:30:57 -07:00
Alexander Morozov
66d8f1a5ea Use goroutine-safe version of rand.Source
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-19 12:32:40 -07:00