use libbruteforce::hash_fncs::sha256_hashing;
use libbruteforce::BasicCrackParameter;
use libbruteforce::{symbols, CrackParameter, TargetHashInput};
use simple_logger::SimpleLogger;
fn main() {
SimpleLogger::new().with_utc_timestamps().init().unwrap();
let alphabet = symbols::Builder::new()
.with_lc_letters()
.with_common_special_chars()
.build();
let sha256_hash = "3d7edde33628331676b39e19a3f2bdb3c583960ad8d865351a32e2ace7d8e02d";
let res = libbruteforce::crack(CrackParameter::new(
BasicCrackParameter::new(alphabet, 3, 0, true),
sha256_hashing(TargetHashInput::HashAsStr(sha256_hash)),
));
if let Some(solution) = res.solution() {
println!("Password is: {}", solution);
println!("Took {:.3}s", res.duration_in_seconds());
}
}