Skip to content

Commit 875f21b

Browse files
authored
password-hash: add CustomizedPasswordHasher::hash_password_with_params (#2121)
Adds a method that just customizes the params, but using the default algorithm and version.
1 parent 8bb7b93 commit 875f21b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

password-hash/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ pub trait CustomizedPasswordHasher<H> {
9292
version: Option<Version>,
9393
params: Self::Params,
9494
) -> Result<H>;
95+
96+
/// Compute a [`PasswordHash`] using customized parameters only, using the default
97+
/// algorithm and version.
98+
fn hash_password_with_params(
99+
&self,
100+
password: &[u8],
101+
salt: &[u8],
102+
params: Self::Params,
103+
) -> Result<H> {
104+
self.hash_password_customized(password, salt, None, None, params)
105+
}
95106
}
96107

97108
/// Trait for password verification.

0 commit comments

Comments
 (0)