use secrets::Secret; fn main() { Secret::<[u8; 16]>::random(|s| { // use `s` as if it were a `&mut [u8; 16]` // // the memory is `mlock(2)`ed and will be zeroed when this closure // exits println!("{:?}", s); println!("{:?}", *s); }); }