delete test file

This commit is contained in:
Cléo Rebert 2020-06-21 16:03:39 +02:00 committed by GitHub
parent 32b618c827
commit 9746793f83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 20 deletions

View File

@ -1,20 +0,0 @@
use std::time::SystemTime;
use totp_rs::{Algorithm, TOTP};
fn main() {
let username = "example".to_string();
let totp = TOTP::new(
Algorithm::SHA1,
6,
1,
30,
"supersecret".to_string().into_bytes(),
);
let time = SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH).unwrap()
.as_secs();
let url = totp.get_url(format!("account:{}", username), "my-org.com".to_string());
println!("{}", url);
let token = totp.generate(time);
println!("{}", token);
}