Math.random() vs crypto.getRandomValues() for UInt32 (v2)

Revision 2 of this benchmark created on


Description

Math.random() vs crypto.getRandomValues() for Uint32 random number.

Setup

const randomStore = new Uint32Array( 1 ) ;

Test runner

Ready to run.

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

Revisions

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