test (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="https://cdn.jsdelivr.net/npm/sha256-uint8array@0.10.7/dist/sha256-uint8array.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/emn178/js-sha256/build/sha256.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-sha3/0.9.3/sha3.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/neelkanthpoosa/Sha3-256/sha3.js"></script>
<script src="https://cdn.jsdelivr.net/npm/hash-wasm@4/dist/sha3.umd.min.js"></script>

Setup

function randomString(length) {
  const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
  let result = '';
  for (let i = 0; i < length; i++) {
    result += chars.charAt(Math.floor(Math.random() * chars.length));
  }
  return result;
}
const text = randomString(64);

Teardown


(async () => {
    const hash = await hashwasm.createSHA3(256);
})();

Test runner

Ready to run.

Testing in
TestOps/sec
test
SHA256.createHash("sha256").update(text)
.digest();
ready
test
sha256.digest(text);
ready
sha3_256
sha3_224.digest(text);
ready
333
(async () => {
    hash.update(text);
    const digest = hash.digest('binary');
})();
ready

Revisions

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