Skip to content

Commit

Permalink
feat: v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
skifli authored Oct 2, 2024
1 parent c242584 commit 9dac86b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bruty_client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bruty_client"
authors = ["skifli"]
version = "0.3.1"
version = "0.3.0"
edition = "2021"

[dependencies]
Expand Down
16 changes: 10 additions & 6 deletions bruty_client/src/client_threads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ use sonic_rs;
struct IDCheckingStats {
total_checked: u16,
positives: Vec<bruty_share::types::Video>,
start_time: std::time::Instant,
}

pub async fn results_handler(client_channels: &bruty_share::types::ClientChannels) {
let mut results_map: ahash::AHashMap<Vec<char>, IDCheckingStats> = ahash::AHashMap::new();
let mut completed_checks: u64 = 0;
let start_time = std::time::Instant::now();

loop {
let video = client_channels.results_receiver.recv_async().await;
Expand All @@ -26,7 +27,6 @@ pub async fn results_handler(client_channels: &bruty_share::types::ClientChannel
let stats = results_map.entry(base_id).or_insert(IDCheckingStats {
total_checked: 0,
positives: Vec::new(),
start_time: std::time::Instant::now(),
});

stats.total_checked += 1;
Expand All @@ -36,16 +36,18 @@ pub async fn results_handler(client_channels: &bruty_share::types::ClientChannel
}

if stats.total_checked == 4096 {
completed_checks += 1;

let base_id_clone_clone = base_id_clone.clone();

let positives_len = stats.positives.len();

log::info!(
"Tested {} @{}/s ({} positive{})",
"Tested {} with {} hit{}, client @{}/s",
base_id_clone.iter().collect::<String>(),
stats.start_time.elapsed().as_secs() / 4096,
positives_len,
if positives_len == 1 { "" } else { "s" }
if positives_len == 1 { "" } else { "s" },
completed_checks as f64 * 4069.0 / start_time.elapsed().as_secs_f64(),
);

client_channels
Expand Down Expand Up @@ -191,6 +193,8 @@ pub async fn generate_all_ids(client_channels: &bruty_share::types::ClientChanne

let base_id = base_id.unwrap();

generate_ids(base_id, client_channels);
generate_ids(base_id.clone(), client_channels);

log::info!("Generated IDs for {}", base_id.iter().collect::<String>());
}
}
4 changes: 2 additions & 2 deletions bruty_client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ struct Args {
#[arg(
short = 'a',
long = "advanced-generations",
help = "Number of IDs to be generated in advance",
default_value_t = 4
help = "Number of IDs to be generated in advance (multiply by 64^2)",
default_value_t = 8
)]
advanced_generations: u8,
}
Expand Down
2 changes: 1 addition & 1 deletion bruty_client/src/payload_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub async fn test_request_data(
};

log::info!(
"Testing {}",
"Generating IDs for {}",
test_request_data.id.iter().collect::<String>()
);

Expand Down
2 changes: 1 addition & 1 deletion bruty_server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bruty_server"
authors = ["skifli"]
version = "0.3.1"
version = "0.3.0"
edition = "2021"

[dependencies]
Expand Down

0 comments on commit 9dac86b

Please sign in to comment.