jonelo / jacksum

A hash utility, est. 2002, FLOSS. 489 hash functions, HMAC support, cross platform, feature-rich, multi threaded. CLI and API. Recursive hashing, predefined and customizable formats, verify data integrity and find ok/failed/missing/new files, find files by their hashes, find the hash function to a hash. GUI provided by HashGarten.
https://jacksum.net
GNU General Public License v3.0
43 stars 5 forks source link

Statistics are all zero if --check-line has been set #22

Closed jonelo closed 1 year ago

jonelo commented 1 year ago

Describe the bug Statistics are all zero if --check-line has been set

To Reproduce

jacksum -a sha256 --check-line "f9bb2cbc9765aab356e2907d3cf09154de107d48f783101d63d909450e3713ca wanted.txt"
       OK  wanted.txt

Jacksum: total lines in check file: 0
Jacksum: improperly formatted lines in check file: 0
Jacksum: properly formatted lines in check file: 0
Jacksum: ignored lines (empty lines and comments): 0
Jacksum: correctness of check file: NaN %

Jacksum: matches (OK): 1
Jacksum: mismatches (FAILED): 0
Jacksum: new files (NEW): 0
Jacksum: missing files (MISSING): 0

Jacksum: total files read: 1
Jacksum: total bytes read: 713
Jacksum: total bytes read (human readable): 713 bytes
Jacksum: total file read errors: 0

Jacksum: elapsed time: 150 ms

Expected behavior one line has been passed by option called --check-line, so it should treat that line as it would come from a check file - also for the statistics.

Screenshots n/a

Environment (please complete the following information): platform independent issue

Additional context n/a

jonelo commented 1 year ago

fixed in commit https://github.com/jonelo/jacksum/commit/206329b7672a2fe0654222b174c91797df9133ed

fix verification:

jacksum35 -a sha256 --check-line "f9bb2cbc9765aab356e2907d3cf09154de107d48f783101d63d909450e3713ca wanted.txt"
       OK  wanted.txt

Jacksum: total lines in check file: 1
Jacksum: improperly formatted lines in check file: 0
Jacksum: properly formatted lines in check file: 1
Jacksum: ignored lines (empty lines and comments): 0
Jacksum: correctness of check file: 100.00 %

Jacksum: matches (OK): 1
Jacksum: mismatches (FAILED): 0
Jacksum: new files (NEW): 0
Jacksum: missing files (MISSING): 0

Jacksum: total files read: 1
Jacksum: total bytes read: 713
Jacksum: total bytes read (human readable): 713 bytes
Jacksum: total file read errors: 0

Jacksum: elapsed time: 157 ms