Browse Source

Added documentation to hash256.rs

Lorenz Bung 7 years ago
parent
commit
cef4324040
No account linked to committer's email address
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      hw7/task1/src/hash256.rs

+ 2
- 1
hw7/task1/src/hash256.rs View File

1
 use hasher_sha256::{Hasher, HashResult};
1
 use hasher_sha256::{Hasher, HashResult};
2
 use hasher_sha256::Sha256;
2
 use hasher_sha256::Sha256;
3
 
3
 
4
-
4
+/// Dieser Datentyp beschreibt die Lösung des Hashverfahrens.
5
 pub struct Solution {
5
 pub struct Solution {
6
     pub number: usize,
6
     pub number: usize,
7
     pub hash: String,
7
     pub hash: String,
8
 }
8
 }
9
 
9
 
10
+/// `verify_product` dient der Verifikation eines gefundenen Hashes.
10
 pub fn verify_product(base: usize, number: usize, difficulty: &String) -> Option<Solution> {
11
 pub fn verify_product(base: usize, number: usize, difficulty: &String) -> Option<Solution> {
11
     let sol = base * number;
12
     let sol = base * number;
12
     let input = sol.to_string();
13
     let input = sol.to_string();

Loading…
Cancel
Save