-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from danielpclark/reporting
Reporting
- Loading branch information
Showing
10 changed files
with
262 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "abrute" | ||
version = "0.1.6" | ||
version = "0.1.7" | ||
authors = ["Daniel P. Clark <[email protected]>"] | ||
description = "AESCrypt Brute force attempter." | ||
documentation = "http:https://danielpclark.github.io/abrute/index.html" | ||
|
@@ -18,3 +18,6 @@ clap = "~2.26" | |
digits = "~1.1.0" | ||
rayon = "~0.8.2" | ||
num_cpus = "~1.7" | ||
serde = "1.0.24" | ||
serde_json = "1.0.8" | ||
tiny_http = "~0.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
pub mod ticker_tape; | ||
pub mod spinner; | ||
use ::Digits; | ||
|
||
#[derive(Debug)] | ||
pub enum CliReporter { | ||
TickerTape, | ||
Spinner, | ||
} | ||
|
||
impl CliReporter { | ||
#[inline] | ||
pub fn report(&self, data: &Digits) { | ||
match *self { | ||
ref _thingy @ CliReporter::TickerTape => ticker_tape::report(data), | ||
ref _thingy @ CliReporter::Spinner => spinner::report(data), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use ::{Digits,ITERATIONS}; | ||
use std::sync::atomic::Ordering; | ||
use std::io::{self, Write}; | ||
|
||
const SPINNER: [char; 10] = ['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏']; | ||
|
||
pub fn report(data: &Digits) { | ||
let global_iterations = ITERATIONS.load(Ordering::SeqCst); | ||
print!( | ||
"\x1b[1000D {} Iterations: {} String: {}", | ||
SPINNER[global_iterations % 10], | ||
global_iterations, | ||
data.to_s() | ||
); | ||
io::stdout().flush().unwrap(); | ||
} |
Oops, something went wrong.