all: Use crypt/rand through its buffered version, but not in benchmarks (#7420)

This commit is contained in:
greatroar
2021-03-02 19:17:20 +01:00
committed by GitHub
parent 55d5e03639
commit 56b5352f64
6 changed files with 22 additions and 10 deletions
+3 -2
View File
@@ -9,9 +9,9 @@ package ur
import (
"bytes"
"context"
"crypto/rand"
"crypto/tls"
"encoding/json"
"math/rand"
"net"
"net/http"
"runtime"
@@ -414,7 +414,8 @@ func CpuBench(ctx context.Context, iterations int, duration time.Duration, useWe
dataSize := 16 * protocol.MinBlockSize
bs := make([]byte, dataSize)
rand.Reader.Read(bs)
r := rand.New(rand.NewSource(time.Now().UnixNano()))
r.Read(bs)
var perf float64
for i := 0; i < iterations; i++ {