Add more from the std
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
use crate::ptr;
|
||||
|
||||
pub fn fill_bytes(_: &mut [u8]) {
|
||||
panic!("this target does not support random data generation");
|
||||
}
|
||||
|
||||
pub fn hashmap_random_keys() -> (u64, u64) {
|
||||
// Use allocation addresses for a bit of randomness. This isn't
|
||||
// particularly secure, but there isn't really an alternative.
|
||||
let stack = 0u8;
|
||||
let heap = Box::new(0u8);
|
||||
let k1 = ptr::from_ref(&stack).addr() as u64;
|
||||
let k2 = ptr::from_ref(&*heap).addr() as u64;
|
||||
(k1, k2)
|
||||
}
|
||||
1
library/std/src/sys/random/unsupported.rs
Symbolic link
1
library/std/src/sys/random/unsupported.rs
Symbolic link
@@ -0,0 +1 @@
|
||||
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/random/unsupported.rs
|
||||
Reference in New Issue
Block a user