feat: add seckey

This commit is contained in:
2022-07-27 00:14:34 +08:00
parent e4af4e6e25
commit 4b32063d93
3 changed files with 141 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
use seckey::SecBytes;
fn main() {
let mut secpass = SecBytes::with(8, |buf| buf.copy_from_slice(&[8; 8][..]));
assert_eq!([8u8; 8], *secpass.read());
let mut wpass = secpass.write();
wpass[0] = 0;
assert_eq!([0, 8, 8, 8, 8, 8, 8, 8], *wpass);
}