13 lines
294 B
Rust
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);
|
|
});
|
|
}
|