
Hi again folks. What's the best module for doing an MD5 hash? More specifically, I want to hash the first few dozen K of a file, and then the entire file - to get two different hashes. I'm seeing at least 3 modules for it: https://hackage.haskhell.org/package/cryptohash-0.11.6/docs/Crypto-Hash-MD5.... https://hackage.haskell.org/package/pureMD5-2.1.2.1/docs/Data-Digest-Pure-MD... https://hackage.haskell.org/package/MissingH-1.3.0.1/docs/Data-Hash-MD5.html Which is best? Thanks! -- Dan Stromberg

On Thu, Nov 12, 2015 at 5:30 PM Dan Stromberg
What's the best module for doing an MD5 hash?
More specifically, I want to hash the first few dozen K of a file, and then the entire file - to get two different hashes.
I would use the one from cryptohash if you're looking for performance, however I must stress that using MD5 for anything "new" is almost certainly a bad idea. If you aren't doing this for compatibility reasons, you should use something else, like BLAKE2: https://blake2.net/ You might also be interested in https://hackage.haskell.org/package/saltine

On Thu, Nov 12, 2015 at 2:37 PM, Patrick Mylund Nielsen < haskell@patrickmylund.com> wrote:
On Thu, Nov 12, 2015 at 5:30 PM Dan Stromberg
wrote: What's the best module for doing an MD5 hash?
More specifically, I want to hash the first few dozen K of a file, and then the entire file - to get two different hashes.
I would use the one from cryptohash if you're looking for performance, however I must stress that using MD5 for anything "new" is almost certainly a bad idea. If you aren't doing this for compatibility reasons, you should use something else, like BLAKE2: https://blake2.net/
You might also be interested in https://hackage.haskell.org/package/saltine
My use of MD5 is strictly non-cryptographic. It is in a limited sense for compatibility with other software - but it's more about doing the same algorithm in multiple languages for the sake of comparison. I'll look at cryptohash. Thanks. Dan Stromberg
participants (2)
-
Dan Stromberg
-
Patrick Mylund Nielsen