#[non_exhaustive]pub enum Algorithm {
SHA1,
SHA256,
SHA512,
Steam,
}Expand description
Algorithm enum holds the three standards algorithms for TOTP as per the reference implementation
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
SHA1
HMAC-SHA1 is the default algorithm of most TOTP implementations. Some will outright silently ignore the algorithm parameter to force using SHA1, leading to confusion.
SHA256
HMAC-SHA256. Supported in theory according to yubico. Ignored in practice by most.
SHA512
HMAC-SHA512. Supported in theory according to yubico. Ignored in practice by most.
Steam
Available on crate feature
steam only.Steam TOTP token algorithm.
Implementations§
Trait Implementations§
impl Copy for Algorithm
Source§impl<'de> Deserialize<'de> for Algorithm
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Algorithm
Available on crate feature
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Algorithm
impl StructuralPartialEq for Algorithm
Auto Trait Implementations§
impl Freeze for Algorithm
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin for Algorithm
impl UnsafeUnpin for Algorithm
impl UnwindSafe for Algorithm
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