Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I believe I came across one by Paul Johnston at <a href="http://pajhome.org.uk/crypt/md5/contrib/sha1_stream.js" rel="nofollow noreferrer">http://pajhome.org.uk/crypt/md5/contrib/sha1_stream.js</a> . It is listed on the page <a href="http://pajhome.org.uk/crypt/md5/scripts.html" rel="nofollow noreferrer">http://pajhome.org.uk/crypt/md5/scripts.html</a> . I have not tested it myself, but I have used his non-streamable version that he modified for it.</p> <p>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 <a href="http://pajhome.org.uk/crypt/md5/sha1.js" rel="nofollow noreferrer">http://pajhome.org.uk/crypt/md5/sha1.js</a>) before the streamable sha1_stream.js.</p> <pre><code>&lt;script src="sha1.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt; &lt;script src="sha1_stream.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt; &lt;script type="text/javascript" charset="utf-8"&gt; var input = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'; var blocksize = 512; var h = naked_sha1_head(); for (var i = 0; i &lt; input.length; i += blocksize) { var len = Math.min(blocksize, input.length - i); var block = input.substr(i, len); naked_sha1(str2binb(block), len*chrsz, h); } var result = binb2hex(naked_sha1_tail(h)); &lt;/script&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload