An incorrect hash is may be generated if a binary string is used. In my case, I was obtaining the string from a FileReader instance's readAsBinaryString() method. It seems to work fine with text files, but binary files throw it off and silently give the wrong hash. Using the recommended method of readAsArrayBuffer() works fine as long as you convert it to Uint8Array before passing it to the hasher via update().
An incorrect hash is may be generated if a binary string is used. In my case, I was obtaining the string from a FileReader instance's readAsBinaryString() method. It seems to work fine with text files, but binary files throw it off and silently give the wrong hash. Using the recommended method of readAsArrayBuffer() works fine as long as you convert it to Uint8Array before passing it to the hasher via update().