authenticator-rs

Crates.ioauthenticator-rs
lib.rsauthenticator-rs
version0.2.0
sourcesrc
created_at2021-12-14 01:26:40.732357
updated_at2021-12-14 04:42:04.677161
descriptionThe rust implementation for google authenticator with 2fa authentication
homepagehttps://github.com/CrayfishGo/authenticator-rs.git
repository
max_upload_size
id497512
size9,917
(CrayfishGo)

documentation

https://docs.rs/authenticator-rs/

README

authenticator-rs

The rust implementation for google authenticator with 2FA authentication

Usage

Add this to your Cargo.toml:

[dependencies]
authenticator-rs = "0.2.0"

Example

use crate::authenticator;

fn main(){
    let secret =  authenticator::create_secret(32); // create a random secret
    let pin_code_rs = authenticator::current_pin_code(secret.as_str(), 6);
    match pin_code_rs {
            Ok(code) => { println!("Current Pin Code: {}", code) }
            Err(e) => { println!("Something has error: {}", e) }
        }
}

Commit count: 0

cargo fmt