Created
January 7, 2020 07:29
-
-
Save josephlr/8e910ea259f574097f5f1ec9c5e05899 to your computer and use it in GitHub Desktop.
getrandom example program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use getrandom::getrandom; | |
fn main() { | |
let mut data = [0u8; 4]; | |
getrandom(&mut data).unwrap(); | |
println!("{}", u32::from_ne_bytes(data)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment