- rnds = [
- Math.floor( Math.random() * 0x100000000 ),
- Math.floor( Math.random() * 0x100000000 )
- ];
- }
- // Convert number to a string with 16 hex characters
- for ( i = 0; i < 2; i++ ) {
- // Add 0x100000000 before converting to hex and strip the extra character
- // after converting to keep the leading zeros.
- hexRnds[ i ] = ( rnds[ i ] + 0x100000000 ).toString( 16 ).slice( 1 );
+ // 0x10000 is 2^16 so the operation below will return a number
+ // between 2^16 and zero
+ for ( i = 0; i < 5; i++ ) {
+ rnds[ i ] = Math.floor( Math.random() * 0x10000 );
+ }