-
-
Notifications
You must be signed in to change notification settings - Fork 316
chore: use math/rand/v2 instead of math/rand #363
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -28,7 +28,7 @@ import ( | |||||
| "errors" | ||||||
| "fmt" | ||||||
| "io/fs" | ||||||
| weakrand "math/rand" | ||||||
| weakrand "math/rand/v2" | ||||||
| "net" | ||||||
| "net/http" | ||||||
| "net/url" | ||||||
|
|
@@ -1236,7 +1236,7 @@ func (cfg *Config) checkStorage(ctx context.Context) error { | |||||
| } | ||||||
| key := fmt.Sprintf("rw_test_%d", weakrand.Int()) | ||||||
| contents := make([]byte, 1024*10) // size sufficient for one or two ACME resources | ||||||
| _, err := weakrand.Read(contents) | ||||||
| _, err := rand.Read(contents) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Should be
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this supposed to be cryptographically secure? |
||||||
| if err != nil { | ||||||
| return err | ||||||
| } | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should import this as
weakrandfor consistency with other files. It's a convention that helps ensure readers know the package is not strong enough for cryptographic use. But then again I guess linters do this too, so I dunno.