blueimp / JavaScript-MD5

JavaScript MD5 implementation. Compatible with server-side environments like node.js, module loaders like RequireJS and all web browsers.
https://blueimp.github.io/JavaScript-MD5/
MIT License
4.55k stars 1.75k forks source link

Error in md5 large file #26

Open Lionad-Morotar opened 4 years ago

Lionad-Morotar commented 4 years ago

Error when md5(aLongString)

image

Should I do this ?

image

blueimp commented 4 years ago

Unfortunately, this library is not suitable to hash large input data - its original use case was to hash email addresses for use with the Gravatar service. If you have a need to hash large input input data you might wanna use an alternative implementation instead, maybe one that makes use of streams.

I wouldn't catch the "string too long" error in the library itself, but either test the input before passing it in or wrap the md5 invocation.