Use the following code to create the correct md5 hash:
function calculateMd5(blob, callback) { var reader = new FileReader(); reader.readAsArrayBuffer(blob); reader.onloadend = function () { var wordArray = CryptoJS.lib.WordArray.create(reader.result), hash = CryptoJS.MD5(wordArray).toString();
Update (a little easier):
function calculateMd5(blob, callback) { var reader = new FileReader(); reader.readAsBinaryString(blob); reader.onloadend = function () { var hash = CryptoJS.MD5(reader.result).toString();
Be sure to include the core.js , lib-typedarrays.js ( important ), and md5.js from the CryptoJS library.
See This fiddle for a complete example (due to access control to the data source it will not work on the fiddle, try on the local server).
source share