Direct port of DoctorMcKay/node-steam-totp
This crate generates Steam 2FA auth codes for a shared secret. It currently requires nightly Rust.
Example
use ;
# async
Direct port of DoctorMcKay/node-steam-totp
This crate generates Steam 2FA auth codes for a shared secret. It currently requires nightly Rust.
use steam_totp::{Time,Secret,generate_auth_code};
# async fn run() -> Result<(), Box<dyn std::error::Error>> {
#
let time = Time::with_offset().await?;
let shared_secret = Secret::from_hex("deadbeefcafe")?;
let auth_code = generate_auth_code(shared_secret, time);
println!("{}", auth_code); // Will print a 5 character code similar to "R7VRC"
#
# Ok(())
# }