- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 477
Move OsRng down to rand #1674
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
Move OsRng down to rand #1674
Conversation
| /// Using a fresh seed **direct from the OS** is the most secure option: | ||
| /// ``` | ||
| /// # use rand::{SeedableRng, rngs::StdRng}; | ||
| /// let rng = StdRng::from_os_rng(); | ||
| /// # use rand::{SeedableRng, rngs::{StdRng, OsRng}}; | ||
| /// let rng = StdRng::try_from_rng(&mut OsRng).unwrap(); | ||
| /// # let _: StdRng = rng; | 
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.
This is certainly less ergonomic than before, but affected us very little.
Unknown: how much this impacts other users.
7f48893    to
    2a71fe4      
    Compare
  
    Also removes std, os_rng features from rand_core
bd43aaf    to
    1d3235c      
    Compare
  
    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.
This reverts a change we did a long time ago. Do you remember why we moved it from rand_os to rand_core in the first place?
| 
 
 | 
CHANGELOG.mdentrySummary
Moves
OsRngfromrand_coretorand.Removes fns
SeedableRng::from_os_rngandtry_from_os_rng.Motivation
This removes the dependency on
getrandom, makingrand_coredependency-free (unlessserdeis enabled) and allowing an easier path to stabilisation ofrand_core. See rust-random/core#13.Details
Removed features
stdandos_rngfromrand_core.