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:150.0) Gecko/20100101 Firefox/150.0
Browser:
Firefox 150
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 months ago
webcrypto sha1
329K/s
webcrypto sha256
283K/s
wasm sha1
113K/s
wasm sha256
92K/s
View exact numbers
Test name
Executions per second
✓
webcrypto sha1
328,823 Ops/sec
webcrypto sha256
282,618 Ops/sec
wasm sha1
112,771 Ops/sec
wasm sha256
92,493 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);});