one_time/
lib.rs

1//! # one-time
2//! Compute HOTP and TOTP values according to RFCs 4226 and 6238.
3//!
4//! This implementation is digest-agnostic.
5//!
6//! ## Features
7//! All features are disabled by default.
8//! - **`std`**: makes `Error` implement `std::error::Error` and uses `std::time::SystemTime` for `totp_now`
9//! - **`libc`**: use libc for getting the time for `totp_now`
10//!
11//! If `std` and `libc` are both enabled, `libc` will be used for `totp_now`.
12
13#![cfg_attr(not(feature = "std"), no_std)]
14
15pub mod error;
16pub mod hotp;
17pub mod totp;
18
19pub use self::hotp::hotp;
20pub use self::totp::totp;
21
22#[cfg(any(feature = "std", feature = "libc"))]
23pub use self::totp::totp_now;
24
25#[cfg(test)]
26mod test;