Math.random() vs crypto.getRandomValues()

Benchmark created on


Description

Math.random() vs crypto.getRandomValues()

Setup

const randomStore = new Uint32Array( 1 ) ;

Test runner

Ready to run.

Testing in
TestOps/sec
Math.random()
Math.random() * 4294967296 ;
ready
crypto.getRandomValues()
self.crypto.getRandomValues( randomStore ) ;
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.