CryproJS md5 & sha1 vs utility

JavaScript performance comparison

Revision 8 of this test case created

Preparation code

<script src="//rghost.net/download/44831610/a5a70e0fb69614a3deaca8588b82d4341f291e74/utility3.js">
</script>
<script src="//crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js">
</script>
<script src="//crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/sha1.js">
</script>
<script src="//crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/sha256.js">
</script>
<script src="//tiny-sha1.googlecode.com/files/tinySHA1.r4.js">
</script>
<script src="//bitbucket.org/keesey/sha1/raw/fcbee69dcc6f6e9038e7d78376ab207e0816896a/bin/sha1.js">
</script>
<script src="//www.movable-type.co.uk/scripts/sha1.js">
</script>
<script>
  var s = "",
      a = [];
  $u.range(0, 65535).forEach(function(num) {
      s += String.fromCharCode(num);
  });

  $u.range(0, 2).forEach(function(num) {
    var x = $u.repeat(s, num);

    $u.range(0, 4).forEach(function() {
      a.push(x);
    });
  });
</script>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
CryptoJs md5
a.forEach(function(str) {
  CryptoJS.MD5(str).toString();
});
pending…
utility md5
a.forEach(function(str) {
  $u.md5(str);
});
pending…
crypto sha1
a.forEach(function(str) {
  CryptoJS.SHA1(str).toString();
});
pending…
utility sha1
a.forEach(function(str) {
  $u.sha1(str);
});
pending…
tiny sha1
a.forEach(function(str) {
  SHA1(str);
});
pending…
movable-type sha1
a.forEach(function(str) {
  sha1.hash(str, true);
});
pending…
other sha1
a.forEach(function(str) {
  sha1.hash(str);
});
pending…
crypto sha256
a.forEach(function(str) {
  CryptoJS.SHA256(str).toString();
});
pending…
utility sha256
a.forEach(function(str) {
  $u.sha256(str);
});
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment