Struct mini_functions::hash::algorithms::scrypt::Scrypt
source · pub struct Scrypt;
Expand description
Implementation of the Scrypt hashing algorithm.
Scrypt
is a struct that represents the Scrypt hashing algorithm,
which is a memory-hard algorithm designed to be computationally intensive,
thereby making it difficult to perform large-scale custom hardware attacks.
This struct implements the HashingAlgorithm
trait, providing a concrete implementation
for hashing passwords using the Scrypt algorithm.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Scrypt
impl<'de> Deserialize<'de> for Scrypt
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Scrypt, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Scrypt, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl HashingAlgorithm for Scrypt
impl HashingAlgorithm for Scrypt
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 Scrypt algorithm.
Given a plaintext password
and a salt
, this method returns a hashed representation
of the password using the Scrypt algorithm.
Parameters
password
: The plaintext password to be hashed.salt
: A cryptographic salt to prevent rainbow table attacks.
Returns
Returns a Result
containing the hashed password as a vector of bytes.
If hashing fails for some reason, it returns a String
detailing the error.
source§impl Ord for Scrypt
impl Ord for Scrypt
source§impl PartialEq for Scrypt
impl PartialEq for Scrypt
source§impl PartialOrd for Scrypt
impl PartialOrd for Scrypt
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Scrypt
impl Serialize for Scrypt
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 Scrypt
impl Eq for Scrypt
impl StructuralEq for Scrypt
impl StructuralPartialEq for Scrypt
Auto Trait Implementations§
impl RefUnwindSafe for Scrypt
impl Send for Scrypt
impl Sync for Scrypt
impl Unpin for Scrypt
impl UnwindSafe for Scrypt
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