-
Notifications
You must be signed in to change notification settings - Fork 71
Add RandomBits trait
#510
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
Add RandomBits trait
#510
Conversation
|
Expanded the API - added fallible methods, and convenience methods allowing one to omit |
|
Also the inherent |
@fjarri perhaps we should document it, but I consider everything to be implicitly variable-time around the integer size. I guess "bit length" is a slightly different question, particularly in regard to that versus the precision / capacity of the underlying type. |
That's fine I guess |
f3e11d3 to
2fa3263
Compare
|
Actually, I am kind of questioning now if the |
|
Perhaps |
Adds a trait for generating a random number of a given bit size.
Can be improved by using masking instead of shift.
bit_length?BoxedUint::random()takebits_precisionas well?