feat: add secrets

This commit is contained in:
2022-10-03 18:34:27 +08:00
parent dc213c4055
commit 50a4d71ad8
3 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
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);
});
}