don't use 'string' as a name

master
rasul 5 years ago
parent c97fdd1410
commit f929fecb73

@ -19,8 +19,8 @@ use sha2::{Digest, Sha512};
/// println!("{}", hash(data, salt));
/// ```
pub fn hash<D: Into<String>, S: Into<String>>(data: D, salt: S) -> String {
let string = salt.into() + &data.into();
let hash = Sha512::digest(string.as_bytes());
let s = salt.into() + &data.into();
let hash = Sha512::digest(s.as_bytes());
hash.iter().map(|b| format!("{:02x}", b)).collect()
}

Loading…
Cancel
Save