Function another_steam_totp::generate_auth_code
source · pub fn generate_auth_code<T>(
shared_secret: T,
time_offset: Option<i64>
) -> Result<String, Error>
Expand description
Generates the 5-character authentication code to login to Steam using your base64-encoded
shared_secret
.
The time_offset
is the number of seconds in which your system is behind Steam’s servers.
If present, this will add the offset onto your system’s current time. Otherwise no offset is
used.
§Examples
use another_steam_totp::generate_auth_code;
let shared_secret = "000000000000000000000000000=";
let time_offset = None;
let code = generate_auth_code(shared_secret, time_offset).unwrap();
assert_eq!(code.len(), 5);