Function chewdata::helper::checksum::select_hasher

source ·
pub fn select_hasher(algorithm_name: &str) -> Result<Box<dyn DynDigest>>
Expand description

Return the hasher link to the algorithm name push in parameter.

Arguments:

  • algorithm_name - A string slice that contain the algorithm name.

§Examples

use chewdata::helper::checksum::select_hasher;
use sha3::Sha3_224Core;;
use sha3::digest::OutputSizeUser;

let result = select_hasher("sha224");
assert!(result.is_ok());
let hash = result.unwrap();
assert_eq!(hash.output_size(), Sha3_224Core::output_size());