unsupported.rs - source
Description: Source of the Rust file `library/std/src/sys/random/unsupported.rs`.

#
std/sys/random/
unsupported.rs

    1use crate::ptr;
    2
    3pub fn fill_bytes(_: &mut [u8]) {
    4    panic!("this target does not support random data generation");
    5}
    6
    7pub fn hashmap_random_keys() -> (u64, u64) {
    8    // Use allocation addresses for a bit of randomness. This isn't
    9    // particularly secure, but there isn't really an alternative.
    10    let stack = 0u8;
    11    let heap = Box::new(0u8);
    12    let k1 = ptr::from_ref(&stack).addr() as u64;
    13    let k2 = ptr::from_ref(&*heap).addr() as u64;
    14    (k1, k2)
    15}