pub struct SecurePasswordHash(/* private fields */);
Expand description
Secure password hash using Argon2id
Implementations§
Source§impl SecurePasswordHash
impl SecurePasswordHash
Sourcepub fn hash_password(password: &str) -> Result<Self, PasswordError>
pub fn hash_password(password: &str) -> Result<Self, PasswordError>
Hash a plaintext password using Argon2id with secure defaults
Uses Argon2id variant which provides resistance against both side-channel and GPU-based attacks.
Sourcepub fn verify_password(&self, password: &str) -> Result<bool, PasswordError>
pub fn verify_password(&self, password: &str) -> Result<bool, PasswordError>
Verify a plaintext password against this hash
Sourcepub fn from_hash_string(hash: String) -> Result<Self, PasswordError>
pub fn from_hash_string(hash: String) -> Result<Self, PasswordError>
Create from a stored hash string
Trait Implementations§
Source§impl Clone for SecurePasswordHash
impl Clone for SecurePasswordHash
Source§fn clone(&self) -> SecurePasswordHash
fn clone(&self) -> SecurePasswordHash
Returns a duplicate 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 SecurePasswordHash
impl Debug for SecurePasswordHash
Source§impl Display for SecurePasswordHash
impl Display for SecurePasswordHash
Source§impl From<SecurePasswordHash> for String
impl From<SecurePasswordHash> for String
Source§fn from(hash: SecurePasswordHash) -> String
fn from(hash: SecurePasswordHash) -> String
Converts to this type from the input type.
Source§impl PartialEq for SecurePasswordHash
impl PartialEq for SecurePasswordHash
Source§impl TryFrom<String> for SecurePasswordHash
impl TryFrom<String> for SecurePasswordHash
impl StructuralPartialEq for SecurePasswordHash
Auto Trait Implementations§
impl Freeze for SecurePasswordHash
impl RefUnwindSafe for SecurePasswordHash
impl Send for SecurePasswordHash
impl Sync for SecurePasswordHash
impl Unpin for SecurePasswordHash
impl UnwindSafe for SecurePasswordHash
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