test

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("hello world");         // 更新要哈希的内容
    const digest = hash.digest();       // 获取哈希结果(Uint8Array)
})();
ready

Revisions

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