datex_core/crypto/random.rs
1use crate::runtime::global_context::get_global_context;
2
3pub fn random_bytes_slice<const SIZE: usize>() -> [u8; SIZE] {
4 let crypto = get_global_context().crypto;
5 crypto.random_bytes(SIZE).try_into().unwrap()
6}
7pub fn random_bytes(size: usize) -> Vec<u8> {
8 let crypto = get_global_context().crypto;
9 crypto.random_bytes(size)
10}