Macro hsh::new_hash

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

This macro creates a new instance of the Hash struct with the given password, salt, and algorithm.

Example

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


let password = "password";
let salt = "salt";
let algo = "bcrypt";
let hash = new_hash!(password, salt, algo);

assert!(hash.is_ok());