Struct libbruteforce::CrackParameter
source · [−]pub struct CrackParameter<T: CrackTarget> { /* private fields */ }
Expand description
Crack parameter for crate::crack<T: CrackTarget>()
. It combines the basic struct
BasicCrackParameter
with the generic TargetHashAndHashFunction
. This separation exists
so that hash selection functions can be written more convenient.
use libbruteforce::{BasicCrackParameter, CrackParameter, TargetHashInput};
use libbruteforce::hash_fncs::sha256_hashing;
use libbruteforce::symbols;
// sha256("a+c")
let sha256_hash = "3d7edde33628331676b39e19a3f2bdb3c583960ad8d865351a32e2ace7d8e02d";
let max_len = 3;
let min_len = 0;
let alphabet = symbols::Builder::new().with_digits().build();
let res = CrackParameter::new(
BasicCrackParameter::new(alphabet, max_len, min_len, false),
sha256_hashing(TargetHashInput::HashAsStr(sha256_hash)),
);
Implementations
Constructor.
use libbruteforce::{BasicCrackParameter, CrackParameter, TargetHashInput};
use libbruteforce::hash_fncs::sha256_hashing;
use libbruteforce::symbols;
// sha256("a+c")
let sha256_hash = "3d7edde33628331676b39e19a3f2bdb3c583960ad8d865351a32e2ace7d8e02d";
let max_len = 3;
let min_len = 0;
let alphabet = symbols::Builder::new().with_digits().build();
let res = CrackParameter::new(
BasicCrackParameter::new(alphabet, max_len, min_len, false),
sha256_hashing(TargetHashInput::HashAsStr(sha256_hash)),
);
Convenient wrapper for BasicCrackParameter::max_length
.
Convenient wrapper for BasicCrackParameter::min_length
.
Convenient wrapper for BasicCrackParameter::fair_mode
.