pub enum HashAlgorithm {
Argon2i,
Bcrypt,
Scrypt,
}
Expand description
Represents the different algorithms available for password hashing.
This enum is used to specify which hashing algorithm should be used when creating a new hashed password.
Variants§
Argon2i
Argon2i - A memory-hard password hashing algorithm.
Resistant against various types of attacks, including:
- GPU-based attacks
- Side-channel attacks
Incorporates multiple parameters to deter attackers:
- Memory usage
- Parallelism
- Time cost
Bcrypt
Bcrypt - A widely used, computationally intensive password hashing algorithm.
Features:
- Based on the Blowfish encryption cipher
- Uses key stretching technique
- Time-consuming and resource-intensive, which makes it resistant to cracking
Scrypt
Scrypt - A memory-hard password hashing algorithm designed for resistance to brute-force attacks.
Features:
- Consumes a large amount of memory
- Makes parallelized attacks difficult and costly
Trait Implementations§
Source§impl Clone for HashAlgorithm
impl Clone for HashAlgorithm
Source§fn clone(&self) -> HashAlgorithm
fn clone(&self) -> HashAlgorithm
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for HashAlgorithm
impl Debug for HashAlgorithm
Source§impl<'de> Deserialize<'de> for HashAlgorithm
impl<'de> Deserialize<'de> for HashAlgorithm
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HashAlgorithm, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HashAlgorithm, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for HashAlgorithm
impl Display for HashAlgorithm
Source§impl FromStr for HashAlgorithm
impl FromStr for HashAlgorithm
Source§impl Hash for HashAlgorithm
impl Hash for HashAlgorithm
Source§impl Ord for HashAlgorithm
impl Ord for HashAlgorithm
Source§fn cmp(&self, other: &HashAlgorithm) -> Ordering
fn cmp(&self, other: &HashAlgorithm) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for HashAlgorithm
impl PartialEq for HashAlgorithm
Source§impl PartialOrd for HashAlgorithm
impl PartialOrd for HashAlgorithm
Source§impl Serialize for HashAlgorithm
impl Serialize for HashAlgorithm
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for HashAlgorithm
impl Eq for HashAlgorithm
impl StructuralPartialEq for HashAlgorithm
Auto Trait Implementations§
impl Freeze for HashAlgorithm
impl RefUnwindSafe for HashAlgorithm
impl Send for HashAlgorithm
impl Sync for HashAlgorithm
impl Unpin for HashAlgorithm
impl UnwindSafe for HashAlgorithm
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more