Editing sha256 This edit will create a new revision. Your details (optional) Name Email (won’t be displayed; might be used for Gravatar) URL Test case details Title * Published (uncheck if you want to fiddle around before making the page public) Description (in case you feel further explanation is needed)(Markdown syntax is allowed) Same as original, but processing 200Kb of text Are you a spammer? (just answer the question) Preparation code Preparation code HTML (this will be inserted in the <body> of a valid HTML5 document in standards mode) (useful when testing DOM operations or including libraries) <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script src="http://www.bichlmeier.info/sha256.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.0.2/build/rollups/sha1.js"></script> <script src="http://crypto-js.googlecode.com/svn/tags/3.0.2/build/rollups/sha256.js"></script> <script src="http://point-at-infinity.org/jssha256/jssha256.js"></script> <script src="http://code.alexweber.com.br/jquery/sha256/jquery.sha256.js"></script> <script src="https://bitbucket.org/keesey/sha1/raw/fcbee69dcc6f6e9038e7d78376ab207e0816896a/bin/sha1.min.js"></script> <script> var digest; </script> Include JavaScript libraries as follows: <script src="//cdn.ext/library.js"></script> Define setup for all tests (variables, functions, arrays or other objects that will be used in the tests) (runs before each clocked test loop, outside of the timed code region) (e.g. define local test variables, reset global variables, clear canvas, etc.) (see FAQ) var SIZE = 200 * 1024; // 200K var chunk = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus in risus non augue vestibulum semper. Nullam feugiat tortor sit amet dolor venenatis ultricies. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque imperdiet ullamcorper ullamcorper. Aliquam eget nunc a diam dapibus ultricies. In hac habitasse platea dictumst. Curabitur nec tortor nibh, fermentum molestie massa. Vestibulum volutpat gravida nisl, vitae viverra eros bibendum a. Vestibulum sed felis arcu, et volutpat leo. Praesent semper, nibh et suscipit auctor, magna enim lacinia diam, id tristique arcu nunc at odio. Nunc vitae est risus, nec placerat velit. Ut rutrum fringilla consectetur. Fusce rutrum dui aliquet ligula suscipit aliquam. Mauris tincidunt, lacus ut suscipit sodales, justo magna accumsan justo, id tristique massa odio semper enim.'; var input = chunk; while (input.length < SIZE) input += chunk; function str2ab(str) { var buf = new ArrayBuffer(str.length*2); // 2 bytes for each char var bufView = new Uint16Array(buf); for (var i=0, strLen=str.length; i<strLen; i++) { bufView[i] = str.charCodeAt(i); } return buf; } Define teardown for all tests (runs after each clocked test loop, outside of the timed code region) (see FAQ) Code snippets to compare Test 1 Title Async (check if this is an asynchronous test) Code digest = sha256_digest(input); Test 2 Title Async (check if this is an asynchronous test) Code digest = SHA256(input); Test 3 Title Async (check if this is an asynchronous test) Code digest = Sha256.hash(input); Test 4 Title Async (check if this is an asynchronous test) Code digest = CryptoJS.SHA256(input); Test 5 Title Async (check if this is an asynchronous test) Code digest = SHA256_hash(input); Test 6 Title Async (check if this is an asynchronous test) Code digest = $.sha256(input); Test 7 Title Async (check if this is an asynchronous test) Code digest = CryptoJS.SHA1(input); Test 8 Title Async (check if this is an asynchronous test) Code digest = sha1.hash(str2ab(input));