To make this efficient I wrote this little script...
When invoked without any hashes in the clipboard, it looks like this: You can calculate all (md5, sha1, sha256, sha512, crc32/xxh32) checksum(s) for all selected files
or a specific hash (Calculate <hash>) or compare it with a hash (that you need to enter / paste into
the input box after choosing any of these options).
It looks like this, if the clipboard contains any hashes: If you have any arbitrary text in the clipboard, e.g. you've copied the whole text from
https://www.xyplorer.com/download/XYHash-19.10.0000.txt
to make sure that your downloaded "xyplorer_full.zip" file has the correct checksum,
the script will scan the clipboard for matching checksums in the order of the value
from the .ini file: Preferred_Hash_Order=md5|sha512|sha256|sha1|crc32
(You are free to adapt that to your requirements!)
A very convenient way to check if the hash for a file is correct...
Btw, there are a lot of options that you can define in the .ini file!
I'm attaching xxhsum.exe as well. You need to modify the .ini after the script was
launched at least once to adapt the path for it (XXH_Sum_32_Exe=) and if you
want to use it at all (Use_XXH_Sum_32=). If you use it, it will replace! the CRC32
hash option... Why that? Because they both generate 8 chars long values and it's
impossible to know if it is crc32 or xxh32.
If you don't know xxh32: https://github.com/Cyan4973/xxHash
It is a very! fast non-cryptographic hash algorithm!
Some values from my PC (2 GB test file from a ram disk, 10 rounds):
Code: Select all
xxh32 vs. md5 = ~5-6x faster
xxh32 vs. sha1 = ~5-6x faster
xxh32 vs. sha256 = ~13x faster
xxh32 vs. sha512 = ~9-10x faster
xxh32 vs. crc32 = ~13x faster
github link. It operates at exactly the same speed!
E.g.:
Code: Select all
xxhsum.exe "R:\BASH Programming Course.iso"
Code: Select all
BASH Programming Course.iso, 2.086.174.720 bytes
Code: Select all
8f213edd|01070.80 ms|R:\BASH Programming Course.iso
Code: Select all
$start = now("msecs");
$hash = runret("""R:\xxhsum.exe"" -H0 ""R:\BASH Programming Course.iso""");
status "Hash: " . gettoken($hash, 1, " ") . " | Time: " . now("msecs") - $start . " msecs";
Code: Select all
Hash: 8f213edd | Time: 1094 msecs