Getting md5sum of a file through Crypto.js
问题 I am trying to get the md5sum of a tar file to produce the same value when using the md5sum linux command and CryptoJS's MD5 method. In JavaScript I do (after a file has been put in an HTML form): var reader = new FileReader(); reader.onloadend = function () { text = (reader.result); } reader.readAsBinaryString(document.getElementById("firmware_firmware").files[0]); var hash = CryptoJS.MD5(text); hash.toString(); In Linux I do: md5sum name_of_file.tar Currently these two produce different