diff --git a/randombytes.js b/randombytes.js index 5d6f442..c497ec3 100644 --- a/randombytes.js +++ b/randombytes.js @@ -20,7 +20,7 @@ var randombytes = (function () { if (crypto && crypto.getRandomValues) return browserBytes - if (require != null) { + if (typeof require === 'function') { // Node.js. Bust Browserify crypto = require('cry' + 'pto') if (crypto && crypto.randomBytes) return nodeBytes