Macro hsh::generate_hash

source ·
macro_rules! generate_hash {
    ($password:expr, $salt:expr, $algo:expr) => { ... };
}
Expand description

This macro generates a new hash for a given password, salt, and algorithm.

Example

extern crate hsh;
use hsh::models::hash::Hash;
use hsh::{generate_hash, models::hash_algorithm::{HashAlgorithm}};

let password = "password";
let salt = "salt";
let algo = "bcrypt";
let hash_bytes = generate_hash!(password, salt, algo);

assert!(hash_bytes.is_ok());