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

Feature Request: add --expect-hashes-in-check-file #10

Closed lexterror closed 2 years ago

lexterror commented 3 years ago

Hi Jonelo,

I wanted to know if it was possible to add -e command with *

I thought maybe you could load all the hashes from the "hash-all-files.txt" and recursively check all files including sub-directories and see if any existing files match any of the store hashes in "hash-all-files.txt"

I looked at the manual and did not see any options for checking a different folder structure later!

Thank you!

lexterror commented 3 years ago

Hi Jonelo!

Sorry if I'm not as technically skilled as you. I thought it was really important to somehow be able to check a different folder structure later!

Thank you!

jonelo commented 3 years ago

Hi lexterror,

sorry if I gave you the impression that there is need to apologise. There is absolutely no need to apologise, because actually I appreciate your ideas and feedback! It will help to make Jacksum better.

So thanks for continuing on #3 by filing this feature request! Let's see ... for now the option -e does take one hash only, namely the hash that we expect during a calculation process.

Your idea to use the hashes from a check list (e.g. "hash-all-files.txt") and feeding the expectation option with it is brilliant, because it will help Jacksum to identify the files just by their hashes even if

a) any file has been renamed or b) any folder has been renamed or c) files has been moved around or d) there is a completely different folder structure

Duplicate files (having the same hash) have to be handled as well, but I like the idea, I just would like to suggest just one modification to the idea: the * will be expanded by shells, so the star cannot be used with --expect (or -e). Therefore I think I it is better to introduce a new flag that tells Jacksum to expect the hashes in the check file: --expect-hashes-in-check-file (for want of a better word)

feature request accepted :-)

jonelo commented 2 years ago

Jacksum v3.4.0 is on the web. See also https://github.com/jonelo/jacksum/releases/tag/v3.4.0