blob: b004335a35176bca8dbd11279455038bdabbf50f [file] [log] [blame]
use crate::fs::File;
use crate::io::Read;
use crate::sync::OnceLock;
static SCHEME: OnceLock<File> = OnceLock::new();
pub fn fill_bytes(bytes: &mut [u8]) {
SCHEME
.get_or_try_init(|| File::open("/scheme/rand"))
.and_then(|mut scheme| scheme.read_exact(bytes))
.expect("failed to generate random data");
}