This library aims to provide implementations of HOTP, TOTP, and OCRA as specified by the RFCs.
Implemented:
Planned:
// htop(key, counter, digits)
// hotp_raw takes bytes as the key
assert_eq!(hotp_raw(b"\xff", 23, 6), 330795);
// hotp takes a hex string as the key
assert_eq!(hotp("ff", 23, 6), 330795);
hotp_custom(b"\xff", 23, 6, Sha1::new());
All the times below are in seconds.
// totp(key, digits, epoch, time_step)
totp("ff", 6, 0, 30); // defaults for most TOTP implementations
totp_raw(b"\xff", 6, 0, 30);
// totp_custom(key, digits, epoch, time_step, current_time, hash)
totp_custom(b"\xff", 6, 0, 30, 255, Sha1::new());