From 12e4c2ffd92329c965f12064bbfa3de0fc82d750 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Mon, 26 Mar 2018 15:57:48 +0200 Subject: Throttle checking multiple passwords. --- src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 05dd895..48b8e4c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ extern crate reqwest; extern crate ring; -use std::env; +use std::{env, thread, time}; use std::error::Error; use ring::digest; @@ -131,7 +131,16 @@ fn main() { return; } + let mut first_round = true; + for pw in passwords { + if first_round { + first_round = false; + } + else { + thread::sleep(time::Duration::new(1, 0)); + } + match check(Password::new(&pw)) { Err(e) => println!("{}", e.description()), Ok(num) => { -- cgit v1.2.3