Simultaneously calculate multiple digests (md5, sha256)?
32
votes
8
answers
14362
views
Under the assumption that disk I/O and free RAM is a bottleneck (while CPU time is not the limitation), does a tool exist that can calculate multiple message digests at once?
I am particularly interested in calculating the MD-5 and SHA-256 digests of large files (size in gigabytes), preferably in parallel. I have tried
openssl dgst -sha256 -md5
, but it only calculates the hash using one algorithm.
Pseudo-code for the expected behavior:
for each block:
for each algorithm:
hash_state[algorithm].update(block)
for each algorithm:
print algorithm, hash_state[algorithm].final_hash()
Asked by Lekensteyn
(21600 rep)
Oct 23, 2014, 10:00 AM
Last activity: Aug 4, 2025, 06:51 AM
Last activity: Aug 4, 2025, 06:51 AM