Skip to content

Instantly share code, notes, and snippets.

@josephlr
Created January 7, 2020 07:29
Show Gist options
  • Save josephlr/8e910ea259f574097f5f1ec9c5e05899 to your computer and use it in GitHub Desktop.
Save josephlr/8e910ea259f574097f5f1ec9c5e05899 to your computer and use it in GitHub Desktop.
getrandom example program
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