2 ms·
"The md5 algorithm needs to be rewritten with performance in mind" Poked around a little, and this area seems a bit under-researched since MD5 went out of favo
by tyingq 6y ago
"The md5 algorithm needs to be rewritten with performance in mind"
Poked around a little, and this area seems a bit under-researched since MD5 went out of favor for many use cases. For example, the SubtleCrypto digest doesn't support it.
There's this WASM implementation[1], that shows 2-37 MB/sec, presumably on fairly modern hardware. But, I can also find an old pure Javascript implementation[2] that shows 5-7 MB/sec on an ancient Pentium4 running Opera[2]. Makes you wonder how it would fare with a recent Chrome/V8 and hardware. There's online tests, but with small inputs and Chrome is fast enough that I get a lot of NaN/Infinity.
Maybe it would be better to use SHA-1 or some other digest supported by the built-in browser SubtleCrypto package. Wouldn't technically be rsync, but this package seems to be intended for use on both sides.
[1] https://www.npmjs.com/package/md5-wasm https://www.npmjs.com/package/md5-wasm
[2] http://www.myersdaily.org/joseph/javascript/md5-speed-test.html http://www.myersdaily.org/joseph/javascript/md5-speed-test.h...
- claytongulick 6y agoHi, author here. It's funny you mention this, I was just revisiting this lib and thinking that SubtleCrypto would be a better option. Also interesting idea to use the md5-wasm, thanks for the link. It's been years since I made this, probably due for a little love.