pub struct CASScrypt;Implementations§
Source§impl CASScrypt
impl CASScrypt
Sourcepub fn hash_password_customized(
password_to_hash: String,
cpu_memory_cost: u8,
block_size: u32,
parallelism: u32,
) -> String
pub fn hash_password_customized( password_to_hash: String, cpu_memory_cost: u8, block_size: u32, parallelism: u32, ) -> String
Hashes a passwith using Scrypt with custom params. Parameters:
- password_to_hash: The password to be hashed.
- cpu_memory_cost: log₂ of the Scrypt parameter
N, the work factor. - block_size:
rparameter: resource usage. - parallelism:
pparameter: parallelization.
Sourcepub fn hash_password(password_to_hash: String) -> String
pub fn hash_password(password_to_hash: String) -> String
Hashes a password using Scrypt. Returns the hashed password as a string.
Sourcepub fn verify_password(
hashed_password: String,
password_to_verify: String,
) -> bool
pub fn verify_password( hashed_password: String, password_to_verify: String, ) -> bool
Verifies a password against a hashed password using Scrypt. Returns true if the password matches the hashed password, false otherwise.
Auto Trait Implementations§
impl Freeze for CASScrypt
impl RefUnwindSafe for CASScrypt
impl Send for CASScrypt
impl Sync for CASScrypt
impl Unpin for CASScrypt
impl UnwindSafe for CASScrypt
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