pub struct TOTP {
pub secret: String,
}
Expand description
Two-step verification of TOTP algorithm
Fields
secret: String
A secret token for the authentication
Implementations
sourceimpl TOTP
impl TOTP
sourcepub fn generate(&self, period: usize, timestamp: usize) -> u32
pub fn generate(&self, period: usize, timestamp: usize) -> u32
Generate a TOTP code.
A TOTP code is an extension of HOTP algorithm.
period
: A period that a TOTP code is valid in seconds
timestamp
: Create TOTP at this given timestamp
Trait Implementations
impl Eq for TOTP
impl StructuralEq for TOTP
impl StructuralPartialEq for TOTP
Auto Trait Implementations
impl RefUnwindSafe for TOTP
impl Send for TOTP
impl Sync for TOTP
impl Unpin for TOTP
impl UnwindSafe for TOTP
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more