Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
uuid generation crypto.getRandomValues
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/134.1 Mobile/15E148 Safari/605.1.15
Browser:
Mobile Safari 16
Operating system:
iOS 16.2
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
uuidv4
321601.8 Ops/sec
random 1
141127.3 Ops/sec
random 2
206352.2 Ops/sec
random 3
551216.9 Ops/sec
Tests:
uuidv4
bits = crypto.getRandomValues(new Uint8Array(20)) bits[5] = (bits[5] & 0x4F) | 0x40; bits[8] = (bits[8] & 0xBF) | 0x80; bits = [...bits].map(e => e.toString(16).padStart(2,'0') ).reduce((a,c,i)=>a+([4,7,10,13].includes(i)?'-':c));
random 1
Array(20).fill(0).map(()=>crypto.getRandomValues(new Uint8Array(1))[0].toString(16).padStart(2,'0')).reduce((a,c,i)=>a+([4,7,10,13].includes(i)?'-':c))
random 2
([1e3]+-10+-10+-1e5).replace(/\d/g, () => crypto.getRandomValues(new Uint8Array(1))[0].toString(16).padStart(2,'0'))
random 3
let s=[]; crypto.getRandomValues(new Uint8Array(20)).map( e => s.push(e.toString(16).padStart(2,'0')) ); [4,7,10,13].map( idx => s[idx]='-' ); s.join('');