Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crypto-browserify

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crypto-browserify - npm Package Compare versions

Comparing version 3.2.5 to 3.2.6

2

package.json

@@ -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)

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc