blob: 4f000dceb2f18ea4e265bec42b50e1ee4fca967c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
use io;
use mem;
use sys::c;
pub fn hashmap_random_keys() -> (u64, u64) {
let mut v = (0, 0);
let ret = unsafe {
c::RtlGenRandom(&mut v as *mut _ as *mut u8,
mem::size_of_val(&v) as c::ULONG)
};
if ret == 0 {
panic!("couldn't generate random bytes: {}",
io::Error::last_os_error());
}
return v
}
|