🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

randombytes

Package Overview
Dependencies
Maintainers
5
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

randombytes - npm Package Compare versions

Comparing version
2.0.2
to
2.0.3
+3
-2
browser.js

@@ -23,4 +23,5 @@ 'use strict'

// See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues
crypto.getRandomValues(rawBytes)
if (size > 0) { // getRandomValues fails on IE if size == 0
crypto.getRandomValues(rawBytes)
}
// phantomjs doesn't like a buffer being passed here

@@ -27,0 +28,0 @@ var bytes = new Buffer(rawBytes.buffer)

+1
-1
{
"name": "randombytes",
"version": "2.0.2",
"version": "2.0.3",
"description": "random bytes from browserify stand alone",

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

@@ -5,3 +5,4 @@ var test = require('tape')

test('sync', function (t) {
t.plan(3)
t.plan(4)
t.equals(randomBytes(0).length, 0, 'len: ' + 0)
t.equals(randomBytes(3).length, 3, 'len: ' + 3)

@@ -13,4 +14,10 @@ t.equals(randomBytes(30).length, 30, 'len: ' + 30)

test('async', function (t) {
t.plan(3)
t.plan(4)
randomBytes(0, function (err, resp) {
if (err) throw err
t.equals(resp.length, 0, 'len: ' + 0)
})
randomBytes(3, function (err, resp) {

@@ -17,0 +24,0 @@ if (err) throw err