From e77c70ef7100ff5af7ff66bb061005063bf918fa Mon Sep 17 00:00:00 2001 From: Emil Bay Date: Wed, 24 Jun 2020 13:37:16 +0200 Subject: [PATCH] Bust crypto in browserify --- randombytes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/randombytes.js b/randombytes.js index 33d67f2..3d5ed20 100644 --- a/randombytes.js +++ b/randombytes.js @@ -18,12 +18,12 @@ var randombytes = (function () { throw new Error('No secure random number generator available') } - crypto = require('crypto') if (crypto && crypto.getRandomValues) return browserBytes if (require != null) { // Node.js. Bust Browserify crypto = require('cry' + 'pto') + if (crypto && crypto.randomBytes) return nodeBytes } return noImpl