File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,6 @@ mod test_time {
37
37
GPU . gflops_fp64 = GPU . GFLOP64 ( ) ;
38
38
39
39
let result = cal_time ( GPU , Entropy ) ;
40
- assert_eq ! ( result, 2295 )
40
+ assert_eq ! ( result, 287 )
41
41
}
42
42
}
Original file line number Diff line number Diff line change @@ -18,11 +18,10 @@ pub mod gpu {
18
18
19
19
impl GPU_Status {
20
20
pub fn GFLOP64 ( & self ) -> u32 {
21
-
22
- ( ( self . clock * self . cuda_core * 2 ) / 4 ) / 1000
21
+ ( self . clock * self . SMP / 2 ) / 1000
23
22
}
24
23
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 ;
26
25
gpu_gflops_FP32
27
26
}
28
27
}
@@ -78,7 +77,6 @@ pub mod gpu {
78
77
let gpu_device = opencl3:: device:: Device :: new ( devices[ gpu_choice as usize ] ) ;
79
78
let gpu_clock = gpu_device. max_clock_frequency ( ) . unwrap ( ) ;
80
79
let gpu_cores = gpu_device. max_compute_units ( ) ?;
81
- let gpu_cores = gpu_cores * 8 ;
82
80
83
81
let mut GPU : GPU_Status = GPU_Status {
84
82
name : gpu_device. name ( ) . unwrap ( ) ,
Original file line number Diff line number Diff line change @@ -168,6 +168,7 @@ async fn password_list(password: String) -> Result<bool, ()> {
168
168
169
169
let mut line = 0 ;
170
170
let mut counter = 0 ;
171
+ let mut errors = 0 ;
171
172
for passwords in reader. lines ( ) {
172
173
counter+=1 ;
173
174
line+=1 ;
@@ -176,14 +177,18 @@ async fn password_list(password: String) -> Result<bool, ()> {
176
177
if passwords == password {
177
178
return Ok ( true ) ;
178
179
}
179
- else if counter % 4000 == 0 {
180
+ else if counter == 351394 {
180
181
println ! ( "Searching..." ) ;
181
182
counter = 0 ;
182
183
}
183
184
}
184
185
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
+ }
187
192
}
188
193
}
189
194
if line >= 2459760 { // if it's at the end of the file, stop the search and return password not found
You can’t perform that action at this time.
0 commit comments