pub struct CASBCrypt;Implementations§
Source§impl CASBCrypt
impl CASBCrypt
Sourcepub fn hash_password_customized(password_to_hash: String, cost: u32) -> String
pub fn hash_password_customized(password_to_hash: String, cost: u32) -> String
Hashes a password using bcrypt with a customized cost. Parameters:
- password_to_hash: The password to be hashed.
- cost: The cost parameter for bcrypt (default is 12 and max is 31). Returns the hashed password as a string.
Sourcepub fn hash_password(password_to_hash: String) -> String
pub fn hash_password(password_to_hash: String) -> String
Hashes a password using bcrypt. 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 bcrypt. Returns true if the password matches the hashed password, false otherwise.
Auto Trait Implementations§
impl Freeze for CASBCrypt
impl RefUnwindSafe for CASBCrypt
impl Send for CASBCrypt
impl Sync for CASBCrypt
impl Unpin for CASBCrypt
impl UnwindSafe for CASBCrypt
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