Trait password_hash::PasswordHasher [−][src]
pub trait PasswordHasher {
type Params: Clone + Debug + Default + for<'a> TryFrom<&'a PasswordHash<'a>, Error = Error> + for<'a> TryInto<ParamsString, Error = Error>;
fn hash_password<'a>(
&self,
password: &[u8],
algorithm: Option<Ident<'a>>,
params: Self::Params,
salt: impl Into<Salt<'a>>
) -> Result<PasswordHash<'a>>;
fn hash_password_simple<'a, S: ?Sized>(
&self,
password: &[u8],
salt: &'a S
) -> Result<PasswordHash<'a>>
where
S: AsRef<str> + ?Sized,
{ ... }
}
Expand description
Trait for password hashing functions.
Associated Types
Required methods
Compute a PasswordHash
with the given algorithm Ident
(or None
for the recommended default), password, salt, and
parameters.
Provided methods
Simple API for computing a PasswordHash
from a password and
Salt
value.
Uses the default recommended parameters for a given algorithm.