Socket
Socket
Sign inDemoInstall

brorand

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.8 to 1.0.9

21

index.js

@@ -19,2 +19,10 @@ var r;

// Emulate crypto API using randy
Rand.prototype._rand = function _rand(n) {
var res = new Uint8Array(n);
for (var i = 0; i < res.length; i++)
res[i] = this.rand.getByte();
return res;
};
if (typeof self === 'object') {

@@ -43,8 +51,8 @@ if (self.crypto && self.crypto.getRandomValues) {

}
}
if (Rand.prototype._rand === undefined) {
} else {
// Node.js or Web worker with no crypto support
try {
var crypto = require('crypto');
if (typeof crypto.randomBytes !== 'function')
throw new Error('Not supported');

@@ -55,10 +63,3 @@ Rand.prototype._rand = function _rand(n) {

} catch (e) {
// Emulate crypto API using randy
Rand.prototype._rand = function _rand(n) {
var res = new Uint8Array(n);
for (var i = 0; i < res.length; i++)
res[i] = this.rand.getByte();
return res;
};
}
}
{
"name": "brorand",
"version": "1.0.8",
"version": "1.0.9",
"description": "Random number generator for browsers and node.js",

@@ -5,0 +5,0 @@ "main": "index.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