OV2 / RapidCRC-Unicode

Windows tool to quickly create and verify hash checksums
https://www.ov2.eu/programs/rapidcrc-unicode
GNU General Public License v2.0
289 stars 30 forks source link

Add compatibility for filesize (in bytes) in digest files #199

Open a-raccoon opened 3 months ago

a-raccoon commented 3 months ago

So, I've been asking a number of devs to include compatibility for reading and generating hash digest files (ie, .sha512) which include optional filesize along with the hash and the optional filename. The filesize is included as non-commented data, wedged between the hash and the filename with normal space delimiting.

Since the format of hash digests are validated anyway to determine whether or not the filename is being included, it's not that big of a deal to validate each line for the presence of filesize info as well. The added benefit of doing so permits software to validate hash digests and discover if files have been renamed or moved (or both) and to heal/repair the hash digest with the new filename or path.

As I understand it, the current formats being validated for are:

FFFFF
FFFFF *path\filename
FFFFF  path\filename

I'd like to see the inclusion of:

FFFF 12345 *path\filename
FFFF 12345  path\filename

_(I will admit I don't fully understand the history behind the "space-astrisk-path" and "double_space-path" formats, nor do I know if you also validate for the sloppy "singlespace-path" form as well.)

I don't think validating for this added filesize format should break anything. And if you're willing, it would be totally awesome if RapidCRC could also generate these hash digests as well, and maybe even perform those extra functions I mentioned about discovering renamed files and repairing digests.

So far VoidTools Everything supports this extended format, HashCheck has promised to add it, and RHash allows it as a user-defined format. I've also just asked OpenHashTab to consider the same.