add POWSolver.solve method

This commit is contained in:
b1ek 2023-08-02 20:44:57 +10:00
parent e304f519ab
commit abe8659823
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 7 additions and 0 deletions

View File

@ -53,6 +53,13 @@ impl POWSolver {
None None
} }
/**
Solve the challenge using just one thread.
*/
pub fn solve_signle(self: &mut POWSolver) -> Option<u128> {
return self.chunk_solve(self.challenge.range.min, self.challenge.range.max);
}
pub fn new(challenge: POWChallenge) -> POWSolver { pub fn new(challenge: POWChallenge) -> POWSolver {
POWSolver { challenge, result: None } POWSolver { challenge, result: None }
} }