-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
math/big: update to math/rand/v2 #70790
Comments
Is the idea here to add something like |
You could use |
I believe it was to discourage people from just calling rand.Read to generate poor quality passwords. |
Using crypto/rand.Int with crypto/rand.Reader seems fine. |
One detail I need from ivy, as well as any simulation tool, is that I can seed it, which crypto/rand will not allow. |
In that case, passing a seeded math/rand/v2.NewChaCha8 to crypto/rand.Int is probably best. ChaCha8 implements Reader because as long as the seed is unpredictable, The same is not true of PCG, so PCG does not implement Reader. |
So the suggestion right now is:
|
Go version
go version 1.23
Output of
go env
in your module/workspace:What did you do?
I wanted to update robpike.io/ivy to math/rand/v2, but was inconvenienced by math/big/Int.Rand using the old random number generator. The type in the signature precludes using v2.
Compatibility of output aside, it should be easy to update, and also a good idea to keep the library consistent. math/rand/v2 is the right one to use.
What did you see happen?
Sadness and pain.
What did you expect to see?
Joy and clear skies.
The text was updated successfully, but these errors were encountered: