Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
crypto.randomUUID() vs crypto.getRandomValues()
(version: 1)
Comparing performance of:
uuid vs random
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
iterations = 1000
Tests:
uuid
const arr = []; for (let i = 0; i < iterations; i++) { arr.push(crypto.randomUUID()); }
random
const arr = []; for (let i = 0; i < iterations; i++) { arr.push(crypto.getRandomValues(new Uint8Array(16))); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
uuid
random
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one month ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0
Browser/OS:
Chrome 143 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
uuid
642.3 Ops/sec
random
692.6 Ops/sec
Related benchmarks:
Math.random vs crypto.getRandom sizes
repeated Math.random() vs crypto.getRandomValues()
Math.random vs crypto.getRandom Alberto
Math.random vs crypto.getRandomValues (2)
Math.random vs crypto.getRandomValues 32 bytes
Math.floor(Math.random()) vs crypto.getRandom
crypto.getRandomValues(new Uint8Array(4)) vs crypto.getRandomValues(new Uint16Array(2)) vs crypto.getRandomValues(new Uint32Array(1))
Simple benchmark
Math.random() vs. random() v2
Comments
Confirm delete:
Do you really want to delete benchmark?