Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the cheapest way to compute md5 digest in Haskell?

Tags:

haskell

md5

I find there is Data.Hash.MD5, Data.Digest.Pure.MD5 and a few other md5sum libraries in Haskell. What is recommended/fastest if I only want to compute the md5sum of a String? I want to compute md5sum many many times, so I am looking for a cheap one.

Edit me if you find it not clear.

like image 908
eccstartup Avatar asked Nov 21 '25 11:11

eccstartup


1 Answers

Author of PureMD5 (Data.Digest.Pure.MD5) here.

"PureMD5" is pure in that it is written in pure Haskell, originally as an exercise while learning Haskell. "Cryptohash" (Data.Hash.MD5) is a binding to a C implementation. I haven't benchmarked against cryptohash specifically, but back in the day puremd5 was about 2-3 times slower than a straight-forward C implementation of MD5.

like image 50
Thomas M. DuBuisson Avatar answered Nov 24 '25 06:11

Thomas M. DuBuisson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!