use std::time::SystemTime;
mod modhex;
mod otp;
mod simple_store;
mod store;
fn main() {
let mut store = simple_store::Store::create("test.txt").unwrap();
loop {
let mut otp = String::new();
_ = std::io::stdin().read_line(&mut otp);
let otp = otp.trim();
let now = SystemTime::now();
let result = store.validate(otp);
let elapsed = now.elapsed().unwrap();
match result {
Ok(()) => println!(">>VALID<<"),
Err(err) => println!("{err}"),
}
println!("Took {}us", elapsed.as_micros());
}
}