mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-13 22:18:35 -07:00
change math/rand to crypto/rand in non-test code
This commit is contained in:
@@ -8,12 +8,14 @@ import (
|
||||
func BenchmarkRand(b *testing.B) {
|
||||
var cnt uint64
|
||||
for i := 0; i < b.N; i++ {
|
||||
// nolint:gosec
|
||||
cnt = rand.Uint64()
|
||||
}
|
||||
_ = cnt
|
||||
}
|
||||
|
||||
func BenchmarkXoRoShiRo128SS(b *testing.B) {
|
||||
// nolint:gosec
|
||||
v, s0, s1 := uint64(0), rand.Uint64(), rand.Uint64()
|
||||
for i := 0; i < b.N; i++ {
|
||||
v, s0, s1 = XoRoShiRo128SS(s0, s1)
|
||||
@@ -22,6 +24,7 @@ func BenchmarkXoRoShiRo128SS(b *testing.B) {
|
||||
}
|
||||
|
||||
func BenchmarkXorShift64Star(b *testing.B) {
|
||||
// nolint:gosec
|
||||
v, s := uint64(0), rand.Uint64()
|
||||
for i := 0; i < b.N; i++ {
|
||||
v, s = XorShift64S(s)
|
||||
|
||||
Reference in New Issue
Block a user