Socket
Socket
Sign inDemoInstall

math-random

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

5

browser.js
module.exports = (function (global) {
var uint32 = 'Uint32Array' in global
var crypto = global.crypto || global.msCrypto
var rando = typeof crypto.getRandomValues === 'function'
var rando = crypto && typeof crypto.getRandomValues === 'function'
var good = uint32 && crypto && rando

@@ -11,3 +11,4 @@ if (!good) return Math.random

function random () {
return crypto.getRandomValues(arr)[0] / max
crypto.getRandomValues(arr)
return arr[0] / max
}

@@ -14,0 +15,0 @@

2

package.json
{
"name": "math-random",
"version": "1.0.0",
"version": "1.0.1",
"description": "a drop-in replacement for Math.random that uses cryptographically secure random number generation, where available",

@@ -5,0 +5,0 @@ "main": "node.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc