pub struct Hasher;
Implementations§
Source§impl Hasher
impl Hasher
Sourcepub fn hash(
password: &str,
rounds: &u32,
algorithm: Algorithm,
override_salt: Option<SaltString>,
) -> Result<HasherResult>
pub fn hash( password: &str, rounds: &u32, algorithm: Algorithm, override_salt: Option<SaltString>, ) -> Result<HasherResult>
Hash a password using PBKDF2 with SHA-256 or SHA-512
§Arguments
password
- The password to hashrounds
- The number of rounds to hash the passwordalgorithm
- The algorithm to use for hashingoverride_salt
- Salt is optional, if not provided a random salt will be generated, this should be the default usage. This is included for testing purposes.
Auto Trait Implementations§
impl Freeze for Hasher
impl RefUnwindSafe for Hasher
impl Send for Hasher
impl Sync for Hasher
impl Unpin for Hasher
impl UnwindSafe for Hasher
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