Skip to content

Commit 94938fd

Browse files
authored
Merge pull request #18 from LimesKey/main
small Bug fix
2 parents f65dda4 + e92700b commit 94938fd

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/cal_time.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ mod test_time {
3737
GPU.gflops_fp64 = GPU.GFLOP64();
3838

3939
let result = cal_time(GPU, Entropy);
40-
assert_eq!(result, 2295)
40+
assert_eq!(result, 287)
4141
}
4242
}

src/gpu/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ pub mod gpu {
1818

1919
impl GPU_Status {
2020
pub fn GFLOP64(&self) -> u32 {
21-
22-
((self.clock * self.cuda_core * 2) / 4) / 1000
21+
(self.clock * self.SMP / 2) / 1000
2322
}
2423
pub fn GFLOP32(&self) -> u32 {
25-
let gpu_gflops_FP32: u32 = (self.clock * self.cuda_core * 2) / 1000;
24+
let gpu_gflops_FP32: u32 = (self.clock * self.SMP * 2) / 1000;
2625
gpu_gflops_FP32
2726
}
2827
}
@@ -78,7 +77,6 @@ pub mod gpu {
7877
let gpu_device = opencl3::device::Device::new(devices[gpu_choice as usize]);
7978
let gpu_clock = gpu_device.max_clock_frequency().unwrap();
8079
let gpu_cores = gpu_device.max_compute_units()?;
81-
let gpu_cores = gpu_cores * 8;
8280

8381
let mut GPU: GPU_Status = GPU_Status {
8482
name: gpu_device.name().unwrap(),

src/main.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ async fn password_list(password: String) -> Result<bool, ()> {
168168

169169
let mut line = 0;
170170
let mut counter = 0;
171+
let mut errors = 0;
171172
for passwords in reader.lines() {
172173
counter+=1;
173174
line+=1;
@@ -176,14 +177,18 @@ async fn password_list(password: String) -> Result<bool, ()> {
176177
if passwords == password {
177178
return Ok(true);
178179
}
179-
else if counter % 4000 == 0 {
180+
else if counter == 351394 {
180181
println!("Searching...");
181182
counter = 0;
182183
}
183184
}
184185
Err(err) => {
185-
println!("Error reading line: {:?}, the error is \"{}\"", line, err);
186-
tokio::time::sleep(Duration::from_secs(1)).await;
186+
errors+=1;
187+
if errors == 15 {
188+
println!("Error reading line: {:?}, the error is \"{}\"", line, err);
189+
tokio::time::sleep(Duration::from_secs(1)).await;
190+
errors = 0;
191+
}
187192
}
188193
}
189194
if line >= 2459760 { // if it's at the end of the file, stop the search and return password not found

0 commit comments

Comments
 (0)