crypto-browserify
Advanced tools
Comparing version 3.2.5 to 3.2.6
@@ -5,3 +5,3 @@ { | ||
"description": "partial implementation of crypto for the browser", | ||
"version": "3.2.5", | ||
"version": "3.2.6", | ||
"homepage": "https://github.com/dominictarr/crypto-browserify", | ||
@@ -8,0 +8,0 @@ "repository": { |
(function() { | ||
var g = ('undefined' === typeof window ? global : window) || {} | ||
var foolBrowserify = require | ||
var foolBrowserify = function (r) { | ||
try { return require(r) } catch (_) { } | ||
} | ||
_crypto = ( | ||
g.crypto || g.msCrypto || foolBrowserify('crypto') | ||
g.crypto || g.msCrypto || foolBrowserify('crypto') || {} | ||
) | ||
@@ -7,0 +9,0 @@ module.exports = function(size) { |
var test = require('tape') | ||
var crypto = require('../') | ||
test('get error message', function (t) { | ||
try { | ||
var b = crypto.randomBytes(10) | ||
t.ok(Buffer.isBuffer(b)) | ||
t.end() | ||
} catch (err) { | ||
t.ok(/not supported/.test(err.message), '"not supported" is in error message') | ||
t.end() | ||
} | ||
}) | ||
test('randomBytes', function (t) { | ||
@@ -33,3 +46,4 @@ t.plan(5); | ||
var smean = Math.sqrt(mean) | ||
console.log(expected - smean, mean, expected + smean) | ||
//console.log doesn't work right on testling, *grumble grumble* | ||
console.log(JSON.stringify([expected - smean, mean, expected + smean])) | ||
t.ok(mean < expected + smean) | ||
@@ -36,0 +50,0 @@ t.ok(mean > expected - smean) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
35175
956