Registry / auth / google-authenticator

google-authenticator

JSON →
library0.4.2rscratesunverified

Interact with the Google Authenticator mobile app for 2-factor-authentication.

# Cargo.toml [dependencies] google-authenticator = "0.4.2"
INSTALL
IMPORT
SIG · GOOGLE-AUTHENTICAT
G
google-authenticator
authrustv0.4.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GoogleAuthenticator
use google_authenticator::GoogleAuthenticator;

Generate a secret and get a time-based one-time password.

use google_authenticator::GoogleAuthenticator; let auth = GoogleAuthenticator::new(); let secret = auth.create_secret(32); let code = auth.get_code(&secret, 30)?; println!("2FA code: {}", code);
Debug
Known issues
gotchaRequires the `time` feature for time-based codes.
fix
Add `features = ["time"]` to Cargo.toml dependency.
affects: >=0.4.0
Upgrade
Version history
0.4.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources
google-authenticator — cargo add google-authenticator · libregistry