refactor: use math/rand only for parallel processor seeding

This commit is contained in:
2026-01-07 11:43:47 +01:00
parent 75a33994db
commit c3d0d16e44

View File

@@ -2,7 +2,6 @@ package commands
import ( import (
"context" "context"
cryptoRand "crypto/rand"
"fmt" "fmt"
"math/rand" "math/rand"
"runtime" "runtime"
@@ -25,11 +24,6 @@ func NewParallelProcessor() *ParallelProcessor {
maxWorkers := max(min(runtime.NumCPU(), 8), 2) maxWorkers := max(min(runtime.NumCPU(), 8), 2)
seed := time.Now().UnixNano() seed := time.Now().UnixNano()
seedBytes := make([]byte, 8)
if _, err := cryptoRand.Read(seedBytes); err == nil {
seed = int64(seedBytes[0])<<56 | int64(seedBytes[1])<<48 | int64(seedBytes[2])<<40 | int64(seedBytes[3])<<32 |
int64(seedBytes[4])<<24 | int64(seedBytes[5])<<16 | int64(seedBytes[6])<<8 | int64(seedBytes[7])
}
return &ParallelProcessor{ return &ParallelProcessor{
maxWorkers: maxWorkers, maxWorkers: maxWorkers,