Expand description
Steam TOTP and confirmation key generation.
This crate provides a pure Rust implementation of the node-steam-totp
library, offering utilities for:
- Generating Steam-compatible TOTP authentication codes
- Creating confirmation keys for mobile trade confirmations
- Generating device IDs from SteamIDs
- Querying Steam server time offsets
§Example
use steam_totp::{generate_auth_code, Secret};
// Generate a TOTP code from a base64 shared secret
let secret = Secret::from_base64("SGVsbG9Xb3JsZDEyMzQ1Njc4OTA=").expect("totp error");
let code = generate_auth_code(&secret, 0).expect("totp error");
println!("Your Steam Guard code: {}", code);Structs§
- Secret
- A secret key that can be provided in multiple formats.
- SteamID
- Represents a Steam ID with all its components.
- Time
Offset Response - Response from querying Steam’s time server.
Enums§
- Totp
Error - Errors that can occur during TOTP operations.
Functions§
- generate_
auth_ code - Generate a Steam-style TOTP authentication code.
- generate_
auth_ code_ for_ time - Generate a Steam-style TOTP code for a specific Unix timestamp.
- generate_
confirmation_ key - Generate a base64 confirmation key for use with mobile trade confirmations.
- generate_
device_ id - Generate a standardized device ID based on a SteamID.
- generate_
device_ id_ with_ env_ salt - Generate a device ID using the
STEAM_TOTP_SALTenvironment variable if set. - get_
time_ offset - Query the Steam servers for the time offset.
- time
- Returns the current local Unix time with an optional offset.
Type Aliases§
- Result
- Result type for TOTP operations.