-
Notifications
You must be signed in to change notification settings - Fork 192
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
deps: replace rand with fastrand for fast-rng feature #774
base: main
Are you sure you want to change the base?
deps: replace rand with fastrand for fast-rng feature #774
Conversation
Replace the rand crate with fastrand in the fast-rng feature path. fastrand is a simpler and lighter-weight RNG implementation that better suits the needs of the fast-rng feature.
Thanks for the PR @roderickvd! We try stick to CSPRNG implementations in |
I understand that rationale. Maybe add it to the documentation for future onlookers like me? I was thrown off because in some other crates, including I know you were not using |
Or, would you entertain having this as a feature flag additional to the current ones for those who don't need the cryptographic security? |
That's a fair point, it should've occurred to me that it could be interpreted that way when I picked the name (and just used the feature name I think we can't really do this using Cargo features unfortunately, because they're additive, so while your code may find a weaker RNG acceptable, other code that also uses UUIDs in your binary may not. I think for now, the best way to use a faster RNG is to use |
Thanks for the hint on the builder. I guess what we could do is have a I could whip it up if you find the idea interesting. Otherwise don't worry about closing this. |
I'm not immediately against this idea, but still a bit uncomfortable with it making a decision about the randomness of UUIDs on behalf of your entire dependency tree. I think we should be trying to move away from using Cargo features for what are effectively API configurations, and instead encourage using the |
Replace the
rand
crate withfastrand
in thefast-rng
feature path.fastrand
is a simpler and lighter-weight RNG implementation that better suits the needs of thefast-rng
feature.