[][src]Struct otplib::Authenticator

pub struct Authenticator { /* fields omitted */ }

Methods

impl Authenticator[src]

pub fn new<T: Into<Vec<u8>>, L: Into<u8>>(secret: T, digits: L) -> Authenticator[src]

pub fn from_base32<T: Into<String>, L: Into<u8>>(
    encoded_secret: T,
    digits: L
) -> Result<Authenticator, Error>
[src]

pub fn from_token_url<T: Into<String>>(token: T) -> Result<Authenticator, Error>[src]

pub fn generate_totp(&self) -> u32[src]

pub fn generate_hotp(&self, counter: u64) -> u32[src]

Trait Implementations

impl Clone for Authenticator[src]

impl Debug for Authenticator[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.