macro_rules! hash_length {
($hash:expr) => { ... };
}
Expand description
This macro returns the length of the password for a given Hash
struct instance.
ยงExample
extern crate hsh;
use hsh::models::{hash::Hash, hash_algorithm::{HashAlgorithm}};
use hsh::{ hash_length, new_hash };
let password = "password";
let salt = "salt";
let algo = "bcrypt";
let hash = new_hash!(password, salt, algo);
assert!(hash.is_ok());
let hash = hash.unwrap();
let password_length = hash_length!(hash);
assert_eq!(password_length, 60);