Registry / auth / totp-lite

totp-lite

JSON →
library2.0.1rscratesunverified

A simple, correct TOTP library for generating time-based one-time passwords.

# Cargo.toml [dependencies] totp-lite = "2.0.1"
INSTALL
IMPORT
SIG · TOTP-LITE
T
totp-lite
authrustv2.0.1
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.

totp_custom
use totp_lite::totp_custom;

Generates a 6-digit TOTP token with a 30-second step.

use totp_lite::totp_custom; use std::time::{SystemTime, UNIX_EPOCH}; let secret = b"supersecret"; let time = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs(); let token = totp_custom(30, 6, secret, time); println!("TOTP: {}", token);
Debug
Known issues
gotchaRequires the `hmac` feature for HMAC-SHA1 support.
fix
Add `features = ["hmac"]` to your Cargo.toml dependency.
affects: >=2.0.0
Upgrade
Version history
2.0.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources
totp-lite — cargo add totp-lite · libregistry