idrassi / DirHash

Windows command line utility to compute hash of directories and files
BSD 3-Clause "New" or "Revised" License
111 stars 11 forks source link

-verify #7

Closed bluelayer closed 3 years ago

bluelayer commented 3 years ago

hello! just found this awesome piece of software and love that support blake3! testing it found one weird behaviour, if you delete one file from the folder(assuming that I'm verifying a folder), [verify] command will just ignore it(nothing displayed), if you add one file to it, will warn about missing hash...?

I'm using this command:

DirHash.exe folder blake3 -skipError -verify hash.txt

idrassi commented 3 years ago

Thank you for the feedback.

This behavior is coherent with the current logic of DirHash: all operations takes directory content as main input and other argument are just parameters. In the case of verification, the input is the file or files and so verification applied to only existing files and the hash.txt is used only to look for hash results of existing files:

An enhancement would be to also display a warning at the end of the verification operation if an entry in hash.txt was not processed. This would make sens since most people will use checksum file as integrity mechanism for directories instead of DirHash full hash since checksum format is compatible with other checksum tool.

Will this change answer your need?

bluelayer commented 3 years ago

if a new file is added, DirHash will not be able to find an entry for it in hash.txt and so a warning is displayed.

this was a surprise to me, and i just loved it, more information is always welcome.

This would make sense since most people will use checksum file as integrity mechanism for directories

this is my situation, I keep one folder with 6k+ files, any corruption or deletion is a fatal failure for me. so yes, that change will help my heart allot =)

idrassi commented 3 years ago

I have published version 1.14 that implements this modification. Feel free to reopen the issue if you are encountering any problems.

bluelayer commented 3 years ago

perfect, thank you!