Expand description
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 steam_totp::{Time,Secret,generate_auth_code};
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"
Re-exports§
pub use time::Time;
Modules§
- error
- Module containing error types used by this crate.
- steam_
api - Module containing deserializable structs for Steam API responses.
- time
Structs§
- Secret
- Struct for working with your TOTP shared secret.
Functions§
- generate_
auth_ code - Generate a Steam TOTP authentication code.
- generate_
auth_ code_ async - Generate a Steam TOTP authentication code asynchronously.
- generate_
auth_ code_ with_ time_ async - Same as
generate_auth_code_async
, but returns also the time found on Steam servers. - generate_
confirmation_ key - Returns a string containing your confirmation key for use with the mobile confirmations web page.
- get_
device_ id - Get a standardized device ID based on your SteamID.
Type Aliases§
- Result
- The
steam_totp
Result type.