Sha256: 876e7460621e564ddb8068e62444c4d12be43757e3b3464dd7d5c77cb0cb1db6
Contents?: true
Size: 1.12 KB
Versions: 4
Compression:
Stored size: 1.12 KB
Contents
#[doc(hidden)] #[macro_export] macro_rules! benches { ($params:path) => { #[cfg(all(test, feature="bench"))] mod bench { #![allow(unused_qualifications, unused_imports)] extern crate test; use self::test::Bencher; use super::*; use ::hashing::Algorithm; #[bench] fn short(b: &mut Bencher) { let password = "hunter2*********".to_owned(); let alg = Algorithm::Single(<$params>::default().into()); println!("Bench params: {:?}", alg); b.iter(|| { alg.hash(password.clone().into()) }) } #[bench] fn long(b: &mut Bencher) { let password = "hunter2".to_owned().repeat(10); println!("Password: {:?}", &password); let alg = Algorithm::Single(<$params>::default().into()); println!("Bench params: {:?}", alg); b.iter(|| { alg.hash(password.clone().into()) }) } } } }
Version data entries
4 entries across 4 versions & 1 rubygems