[#161] *: Do not use math/rand.Read()

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-09-08 17:15:08 +03:00
parent aa12d8c6a6
commit 49ad985cad
15 changed files with 24 additions and 22 deletions

View file

@ -1,9 +1,10 @@
package netmap
import (
"crypto/rand"
"encoding/binary"
"fmt"
"math/rand"
mrand "math/rand"
"sort"
"strconv"
"testing"
@ -28,10 +29,10 @@ func BenchmarkHRWSort(b *testing.B) {
node.SetPublicKey(key)
vectors[i] = nodes{node}
weights[i] = float64(rand.Uint32()%10) / 10.0
weights[i] = float64(mrand.Uint32()%10) / 10.0
}
pivot := rand.Uint64()
pivot := mrand.Uint64()
b.Run("sort by index, no weight", func(b *testing.B) {
realNodes := make([]nodes, netmapSize)
b.ResetTimer()