1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//!Simple and minimalistic `OTP` library.
//!
//!## Feautres
//!
//!- `std`  - Enables std related features like accessing current time.

#![warn(missing_docs)]

#![no_std]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::style))]

///Standard algorithms compatible with `OTP`
pub enum Algorithm {
    ///SHA-1. Default algorithm.
    SHA1,
    ///SHA-256
    SHA256,
    ///SHA-512
    SHA512,
}

impl Default for Algorithm {
    #[inline(always)]
    fn default() -> Self {
        Algorithm::SHA1
    }
}

#[cfg(feature = "std")]
extern crate std;

mod hotp;
pub use hotp::HOTP;
mod totp;
pub use totp::TOTP;