chore: reorg

This commit is contained in:
2020-10-17 11:47:07 +08:00
parent 9d4d830115
commit a034988643
56 changed files with 13431 additions and 0 deletions

13
__crypto/totp/src/main.rs Normal file
View File

@@ -0,0 +1,13 @@
extern crate otpauth;
extern crate time;
use otpauth::TOTP;
fn main() {
let auth = TOTP::new("python");
let timestamp1 = time::now().to_timespec().sec as usize;
let code = auth.generate(30, timestamp1);
let timestamp2 = time::now().to_timespec().sec as usize;
println!("code: {}", code);
assert_eq!(true, auth.verify(code, 30, timestamp2));
}