]> Cypherpunks repositories - gostls13.git/commit
math/rand: add Rand.Uint64
authorFlorian Uekermann <florian@uekermann.me>
Wed, 17 Aug 2016 16:45:57 +0000 (18:45 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 3 Oct 2016 15:04:39 +0000 (15:04 +0000)
commit003a598bf28ae8f77919c3bda2abb9d6d4f449bb
treef3b119cd6a513eff3eeaa839147820948532c316
parent998419575fb34dd5228cfdb353a73184e29db8da
math/rand: add Rand.Uint64

This adds Uint64 methods to Rand and rngSource.
Rand.Uint64 uses Source.Uint64 directly if it is present.

rngSource.Uint64 provides access to all 64 bits generated by the
underlying ALFG. To ensure high seed quality a 64th bit has been added
to all elements of the array of "cooked" random numbers that are used
for seeding. gen_cooked.go generates both the 63 bit and 64 bit array.

Fixes #4254

Change-Id: I22855618ac69abae3d2799b3e7e59996d4c5a4b1
Reviewed-on: https://go-review.googlesource.com/27253
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/math/rand/race_test.go
src/math/rand/rand.go
src/math/rand/regress_test.go
src/math/rand/rng.go