Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update to actual rand seed instead deprecated #376

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions z/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ func init() {
allocs = make(map[uint64]*Allocator)

// Set up a unique Ref per process.
rand.Seed(time.Now().UnixNano())
allocRef = uint64(rand.Int63n(1<<16)) << 48 //nolint:gosec // cryptographic precision not needed
rand.New(rand.NewSource(time.Now().UnixNano()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are ignoring the Rand source returned by rand.New. In this case, we can simply remove this line and continue to use the global source. I created a PR here #385

allocRef = uint64(rand.Int63n(1<<16)) << 48

calculatedLog2 = make([]int, 1025)
for i := 1; i <= 1024; i++ {
Expand Down