Files
simple-rust-tests/__security/secrets/src/main.rs
2022-10-03 18:34:27 +08:00

13 lines
294 B
Rust

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);
});
}