pub struct Argon2i;
Expand description
Implementation of the Argon2i hashing algorithm.
Argon2i
is a struct that represents the Argon2i hashing algorithm,
which is a memory-hard algorithm resistant to GPU-based attacks and side-channel attacks.
It is one of the multiple hashing algorithms that can be used for password hashing in this library.
This struct implements the HashingAlgorithm
trait, providing a concrete implementation
for hashing passwords using the Argon2i algorithm.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Argon2i
impl<'de> Deserialize<'de> for Argon2i
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Argon2i, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Argon2i, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl HashingAlgorithm for Argon2i
impl HashingAlgorithm for Argon2i
Source§fn hash_password(password: &str, salt: &str) -> Result<Vec<u8>, String>
fn hash_password(password: &str, salt: &str) -> Result<Vec<u8>, String>
Hashes a given password using the Argon2i algorithm.
This method computes a hashed representation of the plaintext password
using the Argon2i algorithm,
combined with the provided salt
for added security.
§Parameters
password
: The plaintext password to be hashed.salt
: A cryptographic salt to prevent rainbow table attacks.
§Returns
Returns a Result
with Ok
, containing the hashed password as a vector of bytes.
Currently, this function does not handle hashing errors and will always return Ok
.
Source§impl Ord for Argon2i
impl Ord for Argon2i
Source§impl PartialOrd for Argon2i
impl PartialOrd for Argon2i
Source§impl Serialize for Argon2i
impl Serialize for Argon2i
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,
impl Copy for Argon2i
impl Eq for Argon2i
impl StructuralPartialEq for Argon2i
Auto Trait Implementations§
impl Freeze for Argon2i
impl RefUnwindSafe for Argon2i
impl Send for Argon2i
impl Sync for Argon2i
impl Unpin for Argon2i
impl UnwindSafe for Argon2i
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
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>
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>
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