sha256 (v65)

Revision 65 of this benchmark created by emn178 on


Preparation HTML

<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="https://rawgit.com/alexweber/jquery.sha256/master/jquery.sha256.min.js"></script>
<script src="http://crypto.stanford.edu/sjcl/sjcl.js"></script>
<script src="http://www.bichlmeier.info/sha256.js"></script>
<script src="http://vibornoff.com/asmcrypto.js"></script>
<script src="http://caligatio.github.io/jsSHA/sha.js"></script>
<script src="http://www.webtoolkit.info/djs/webtoolkit.sha256.js"></script>
<script src="http://www.movable-type.co.uk/scripts/utf8.js"></script>
<script src="http://www.movable-type.co.uk/scripts/sha256.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/sha256.js"></script>
<script src="https://rawgit.com/emn178/js-sha256/master/src/sha256.js"></script>
<script>
js_sha256 = sha256;
sha256 = null;
</script>
<script src="https://rawgit.com/dchest/fast-sha256-js/master/sha256.min.js"></script>
<script>
fast_sha256 = sha256;
sha256 = null;
</script>
<script src="https://rawgit.com/h2non/jshashes/master/hashes.min.js"></script>
<script>
Hashes_SHA256 =  new Hashes.SHA256;

var HEX_CHARS = '0123456789abcdef'.split('');
function toHexString(bytes) {
  var str = '';
  for(var i = 0;i < bytes.length;++i) {
    str += HEX_CHARS[bytes[i] >> 4] + HEX_CHARS[bytes[i] & 0x0F];
  }
  return str;
}
</script>

Setup

var str = 'The quick brown fox jumps over the lazy dog.';

Test runner

Ready to run.

Testing in
TestOps/sec
CryptoJS
CryptoJS.SHA256(str).toString();
ready
webtoolkit
SHA256(str);
ready
movable-type.co.uk
Sha256.hash(str);
ready
js-sha256
js_sha256(str);
ready
jsHashes
Hashes_SHA256.hex(str);
ready
bichlmeier
sha256_digest(str);
ready
asmCrypto
asmCrypto.SHA256.hex(str);
ready
jsSHA
new jsSHA(str, "TEXT").getHash("SHA-256", "HEX");
ready
jquery.sha256
$.sha256(str);
ready
SJCL
sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(str));
ready
fast-sha256-js
toHexString(fast_sha256(str));
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.