#steam #totp #generate #codes #shared-secret

simple-steam-totp

Generate Steam TOTP auth codes from Rust

1 unstable release

0.1.0 Jan 15, 2022

#18 in #shared-secret

MIT license

4KB

simple-steam-totp

Generate Steam TOTP auth codes from Rust.

Your Steam TOTP shared secret is required to generate codes, here's how you can get it.

Crates.io package

Installation

Add simple-steam-totp = "0.1.0" under your [dependencies] in Cargo.toml

Usage

use simple_steam_totp::{generate};

fn main() {
    //                          ↓↓↓ Shared secret, must be a valid base64 encoded string
    match generate("V59i4SUqNiuYDrssYyMz62RSI9k=") {
        Ok(code) => println!("Code: {}", code),
        Err(e) => println!("Error: {}", e),
    }
}

License

Licensed under MIT.

Dependencies

~4MB
~55K SLoC