Created
July 3, 2014 20:02
-
-
Save Evgenus/8741dea6cde9bd1d1288 to your computer and use it in GitHub Desktop.
SJCL hash performance test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://bitwiseshiftleft.github.io/sjcl/sjcl.js"></script> | |
<script type="text/javascript"> | |
var c, i, q, sjcl, _i, _j; | |
c = "7"; | |
for (i = _i = 1; _i <= 5; i = ++_i) { | |
c = "(" + c + " + " + c + ")"; | |
} | |
q = c; | |
for (i = _j = 1; _j <= 12; i = ++_j) { | |
q = "(" + q + " + " + q + ")"; | |
} | |
function hashfunc(data) { | |
return sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(data)); | |
}; | |
alert("data set = " + q.length) | |
</script> | |
</head> | |
<body> | |
<button onclick="alert(hashfunc(q))">Hit me!</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment