pub struct TotpVerifier { /* private fields */ }Expand description
TOTP 验证器
Implementations§
Source§impl TotpVerifier
impl TotpVerifier
Sourcepub fn with_time_step(self, step: u64) -> Self
pub fn with_time_step(self, step: u64) -> Self
配置时间步长
Sourcepub fn with_drift(self, drift: u64) -> Self
pub fn with_drift(self, drift: u64) -> Self
配置允许的时间窗口漂移
Sourcepub fn generate_at(&self, base32_secret: &str, timestamp: u64) -> String
pub fn generate_at(&self, base32_secret: &str, timestamp: u64) -> String
生成指定时间戳的 TOTP 码
Sourcepub fn generate_now(&self, base32_secret: &str) -> String
pub fn generate_now(&self, base32_secret: &str) -> String
生成当前时间的 TOTP 码
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TotpVerifier
impl RefUnwindSafe for TotpVerifier
impl Send for TotpVerifier
impl Sync for TotpVerifier
impl Unpin for TotpVerifier
impl UnsafeUnpin for TotpVerifier
impl UnwindSafe for TotpVerifier
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