Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
hex to array buffer
convert hex to array buffer
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 134
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
regex match
232294.2 Ops/sec
parseInt 16
757726.8 Ops/sec
Script Preparation code:
var hexVal = 'ed0c356af33bb022afe7c5f8557ad89c'; function hexToArrayBuffer(hex) { return new Uint8Array(hex.match(/[\da-f]{2}/gi).map((h) => { return parseInt(h, 16); })).buffer; } function hexStringToUint8Array(hexString) { var arrayBuffer = new Uint8Array(hexString.length / 2); for (var i = 0; i < hexString.length; i += 2) { var byteValue = parseInt(hexString.substr(i, 2), 16); arrayBuffer[i / 2] = byteValue; } return arrayBuffer; }
Tests:
regex match
hexToArrayBuffer(hexVal)
parseInt 16
hexStringToUint8Array(hexVal)