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?
to your account
The crypto/rand has both a Read function and a Reader object for passing in as an io.Reader. The math/rand package only has a Read function and no Reader object.
Should we add a Reader to math/rand to make it consistent with crypto/rand?
The text was updated successfully, but these errors were encountered:
I thought this was a dup, but I was thinking of #8330 which went most of the way, but not all the way.
I still think there was an open bug or thread about this, but I don't remember the outcome.
Sorry, something went wrong.
When #8330 was first implemented, I noticed that it didn't include an implementation for a Reader object. Back then, I didn't speak up because it's not a big deal.
I think it'd be nice, but everytime I really wanted to use random Reader, I just do rand.New(rand.NewSource(0)) and move on in life.
It would be nice, in particular to provide a concurrent safe version of rand.New(rand.NewSource(0)) that can be used for instance for github.com/google/uuid.SetRand() for fast concurrent uuid generation
No branches or pull requests