pub trait CustomizedPasswordHasher<H> {
type Params: Clone + Debug + Default + Display + FromStr;
// Required method
fn hash_password_customized(
&self,
password: &[u8],
salt: &[u8],
algorithm: Option<&str>,
version: Option<u32>,
params: Self::Params,
) -> Result<H, Error>;
// Provided method
fn hash_password_with_params(
&self,
password: &[u8],
salt: &[u8],
params: Self::Params,
) -> Result<H, Error> { ... }
}Available on crate feature
password-hash only.Expand description
Trait for password hashing functions which support customization.
Generic around a password hash to be returned (typically [PasswordHash])
Required Associated Types§
Required Methods§
Sourcefn hash_password_customized(
&self,
password: &[u8],
salt: &[u8],
algorithm: Option<&str>,
version: Option<u32>,
params: Self::Params,
) -> Result<H, Error>
fn hash_password_customized( &self, password: &[u8], salt: &[u8], algorithm: Option<&str>, version: Option<u32>, params: Self::Params, ) -> Result<H, Error>
Compute a [PasswordHash] from the provided password using an
explicit set of customized algorithm parameters as opposed to the
defaults.
When in doubt, use PasswordHasher::hash_password instead.