pub struct TOTP { /* private fields */ }Implementations§
Source§impl TOTP
impl TOTP
pub fn new(secret: &str) -> TOTP
pub fn from_base32(secret: &str) -> Result<TOTP>
pub fn from_bytes(secret: &[u8]) -> TOTP
pub fn generate(&self, period: u64, timestamp: u64) -> Result<u32>
pub fn verify(&self, code: u32, period: u64, timestamp: u64) -> bool
pub fn to_uri(&self, label: &str, issuer: &str) -> String
Trait Implementations§
impl Eq for TOTP
impl StructuralPartialEq for TOTP
Auto Trait Implementations§
impl Freeze for TOTP
impl RefUnwindSafe for TOTP
impl Send for TOTP
impl Sync for TOTP
impl Unpin for TOTP
impl UnwindSafe for TOTP
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more