cargo fmt
This commit is contained in:
1 file changed
+5
-3
+5
-3
@@ -12,7 +12,7 @@ use rand::distr::SampleString;
|
||||
|
||||
pub struct SaltString {
|
||||
pub raw: String,
|
||||
pub in_bytes: Vec<u8>
|
||||
pub in_bytes: Vec<u8>,
|
||||
}
|
||||
|
||||
impl SaltString {
|
||||
@@ -21,7 +21,7 @@ impl SaltString {
|
||||
let s = rand::distr::Alphanumeric.sample_string(&mut rng, 20);
|
||||
let salt_string = SaltString {
|
||||
raw: (&s).to_string(),
|
||||
in_bytes: s.into_bytes()
|
||||
in_bytes: s.into_bytes(),
|
||||
};
|
||||
|
||||
Ok(salt_string)
|
||||
@@ -70,7 +70,9 @@ pub fn hash_password(
|
||||
// parameters, salt, and the hash itself.
|
||||
// Ok(argon2.hash_password(password_bytes, salt)?.to_string())
|
||||
// Ok(argon2.hash_password(password_bytes)?.to_string())
|
||||
Ok(argon2.hash_password_with_salt(password_bytes, &salt.in_bytes)?.to_string())
|
||||
Ok(argon2
|
||||
.hash_password_with_salt(password_bytes, &salt.in_bytes)?
|
||||
.to_string())
|
||||
}
|
||||
|
||||
pub fn verify_password(
|
||||
|
||||
Reference in new issue
Block a user