Get `N` bytes of random data. This function is mildly expensive to call, as it fetches random data directly from the OS entropy source. # Panics Panics if the OS entropy source returns an error.
()
| 7 | /// |
| 8 | /// Panics if the OS entropy source returns an error. |
| 9 | pub fn os_random<const N: usize>() -> [u8; N] { |
| 10 | let mut buf = [0u8; N]; |
| 11 | getrandom::fill(&mut buf).unwrap(); |
| 12 | buf |
| 13 | } |
no test coverage detected