]> git.lizzy.rs Git - rust.git/blob - src/libstd/sys/windows/rand.rs
Rollup merge of #60429 - estebank:pub-path, r=michaelwoerister
[rust.git] / src / libstd / sys / windows / rand.rs
1 use crate::io;
2 use crate::mem;
3 use crate::sys::c;
4
5 pub fn hashmap_random_keys() -> (u64, u64) {
6     let mut v = (0, 0);
7     let ret = unsafe {
8         c::RtlGenRandom(&mut v as *mut _ as *mut u8,
9                         mem::size_of_val(&v) as c::ULONG)
10     };
11     if ret == 0 {
12         panic!("couldn't generate random bytes: {}",
13                io::Error::last_os_error());
14     }
15     return v
16 }