pub fn hash_password(pass: String, salt: &String) -> String {
    let mut out = [0u8; CRE_LEN];
    pbkdf2::derive(
        &digest::SHA512,
        N_ITER,
        salt.as_bytes(),
        pass.as_bytes(),
        &mut out,
    );
    unsafe { String::from_utf8_unchecked(out.to_vec()) }
}
/// Encrypt a password using a salt
///
/// Using a salt generate by `gen_salt` this function encrypts a password.
/// This function **returns an invalid string** of bytes.
/// Do not attempt to parse or otherwise do anything with this string.
Encrypt a password using a salt
Using a salt generate by `gen_salt` this function encrypts a password.
This function **returns an invalid string** of bytes.
Do not attempt to parse or otherwise do anything with this string.
Encrypt a password using a salt Using a salt generate by ` gen_salt ` this function encrypts a password . This function ** returns an invalid string ** of bytes . Do not attempt to parse or otherwise do anything with this string .
pub fn hash_password(pass: String, salt: &String) -> String {
    let mut out = [0u8; CRE_LEN];
    pbkdf2::derive(
        &digest::SHA512,
        N_ITER,
        salt.as_bytes(),
        pass.as_bytes(),
        &mut out,
    );
    unsafe { String::from_utf8_unchecked(out.to_vec()) }
}
pub fn hash_password ( pass : String , salt : & String ) -> String { let mut out = [ 0u8 ; CRE_LEN ] ; pbkdf2 :: derive ( & digest :: SHA512 , N_ITER , salt . as_bytes ( ) , pass . as_bytes ( ) , & mut out , ) ; unsafe { String :: from_utf8_unchecked ( out . to_vec ( ) ) } }
Encrypt a password using a salt
Using a salt generate by `gen_salt` this function encrypts a password.
Encrypt a password using a salt Using a salt generate by ` gen_salt ` this function encrypts a password .
pass
String
salt
&String
pass
String
salt
&String