I have the same problem as :Can SHA-1 algorithm be computed on a stream? With low memory footprint?
I’m looking for a JavaScript implementation which computed block by block of a very large string. The idea is to slice the string into 512 bits block and do it block by block.
Any hint?
[updated]
Thanks sunetos’s help, I write a litte html5 java script app: Generate SHA1 File Checksum Using HTML5 File API in Javascript
I believe I came across one by Paul Johnston at http://pajhome.org.uk/crypt/md5/contrib/sha1_stream.js . It is listed on the page http://pajhome.org.uk/crypt/md5/scripts.html . I have not tested it myself, but I have used his non-streamable version that he modified for it.
UPDATE: Here is some example code (I verified it against a separate SHA1 known to be correct). Make sure you include the original sha1.js (found at http://pajhome.org.uk/crypt/md5/sha1.js) before the streamable sha1_stream.js.