ootp 0.0.4

OOTP (Open One-time Password) is a supports multiple programming languages. The generated one-time passwords are fully compliant with HOTP (HMAC-based One-time Password) and TOTP (Time-based One-time Password). 🚀It's easy to use!
Documentation

OOTP

OOTP (Open One-time Password) is a supports multiple programming languages. The generated one-time passwords are fully compliant with HOTP (HMAC-based One-time Password) and TOTP (Time-based One-time Password). 🚀It's easy to use!

Introduction

The OOTP for Rust library is a Rust implementation of the OOTP library.

Features

  • Generate one-time passwords for multiple languages
  • 100% Open source
  • HOTP
  • TOTP
  • RFC 4226
  • RFC 6238

Installation

Add the following line to your Cargo.toml file:

[dependencies]
ootp = "0.2"

or use the following command:

$ cargo install ootp

Get started

use ootp::TOTP

fn main() {
    let secret = String::from("Base32 decoded secret");
    let period = 30; // 30 seconds
    let digits = 6; // 6 digits

    let totp = TOTP::new(secret, digits, period);

    let otp = totp.make(); // Generate a one-time password
    println!("{}", otp); // Print the one-time password
}

Examples

Documentation

License

The OOTP for Rust library is licensed under the MIT license.