Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
hash-wasm vs Web Crypto API
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Browser:
Firefox 128
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
webcrypto sha1
209K/s
webcrypto sha256
182K/s
wasm sha1
51K/s
wasm sha256
42K/s
View exact numbers
Test name
Executions per second
✓
webcrypto sha1
208,947 Ops/sec
webcrypto sha256
182,246 Ops/sec
wasm sha1
50,500 Ops/sec
wasm sha256
42,057 Ops/sec
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/hash-wasm@4"></script>
Script Preparation code:
var data = new Uint32Array(1024); window.crypto.getRandomValues(data); var dataBuffer = new Uint8Array(data); data = String.fromCharCode.apply(null, dataBuffer);
Tests:
wasm sha256
console.log(hashwasm.sha256(data));
webcrypto sha256
crypto.subtle.digest("SHA-256", dataBuffer).then(function (hash) {console.log(hash);});
wasm sha1
console.log(hashwasm.sha1(data));
webcrypto sha1
crypto.subtle.digest("SHA-1", dataBuffer).then(function (hash) {console.log(hash);});