diff options
Diffstat (limited to 'node_modules/randombytes')
-rw-r--r-- | node_modules/randombytes/.travis.yml | 15 | ||||
-rw-r--r-- | node_modules/randombytes/.zuul.yml | 1 | ||||
-rw-r--r-- | node_modules/randombytes/LICENSE | 21 | ||||
-rw-r--r-- | node_modules/randombytes/README.md | 14 | ||||
-rw-r--r-- | node_modules/randombytes/browser.js | 38 | ||||
-rw-r--r-- | node_modules/randombytes/index.js | 1 | ||||
-rw-r--r-- | node_modules/randombytes/package.json | 36 | ||||
-rw-r--r-- | node_modules/randombytes/test.js | 56 |
8 files changed, 0 insertions, 182 deletions
diff --git a/node_modules/randombytes/.travis.yml b/node_modules/randombytes/.travis.yml deleted file mode 100644 index 69fdf7130..000000000 --- a/node_modules/randombytes/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -sudo: false -language: node_js -matrix: - include: - - node_js: '7' - env: TEST_SUITE=test - - node_js: '6' - env: TEST_SUITE=test - - node_js: '5' - env: TEST_SUITE=test - - node_js: '4' - env: TEST_SUITE=test - - node_js: '4' - env: TEST_SUITE=phantom -script: "npm run-script $TEST_SUITE" diff --git a/node_modules/randombytes/.zuul.yml b/node_modules/randombytes/.zuul.yml deleted file mode 100644 index 96d9cfbd3..000000000 --- a/node_modules/randombytes/.zuul.yml +++ /dev/null @@ -1 +0,0 @@ -ui: tape diff --git a/node_modules/randombytes/LICENSE b/node_modules/randombytes/LICENSE deleted file mode 100644 index fea9d48a4..000000000 --- a/node_modules/randombytes/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 crypto-browserify - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/randombytes/README.md b/node_modules/randombytes/README.md deleted file mode 100644 index 3bacba4d1..000000000 --- a/node_modules/randombytes/README.md +++ /dev/null @@ -1,14 +0,0 @@ -randombytes -=== - -[](https://www.npmjs.org/package/randombytes) [](https://travis-ci.org/crypto-browserify/randombytes) - -randombytes from node that works in the browser. In node you just get crypto.randomBytes, but in the browser it uses .crypto/msCrypto.getRandomValues - -```js -var randomBytes = require('randombytes'); -randomBytes(16);//get 16 random bytes -randomBytes(16, function (err, resp) { - // resp is 16 random bytes -}); -``` diff --git a/node_modules/randombytes/browser.js b/node_modules/randombytes/browser.js deleted file mode 100644 index 58990c557..000000000 --- a/node_modules/randombytes/browser.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict' - -function oldBrowser () { - throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11') -} - -var Buffer = require('safe-buffer').Buffer -var crypto = global.crypto || global.msCrypto - -if (crypto && crypto.getRandomValues) { - module.exports = randomBytes -} else { - module.exports = oldBrowser -} - -function randomBytes (size, cb) { - // phantomjs needs to throw - if (size > 65536) throw new Error('requested too many random bytes') - // in case browserify isn't using the Uint8Array version - var rawBytes = new global.Uint8Array(size) - - // This will not work in older browsers. - // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues - if (size > 0) { // getRandomValues fails on IE if size == 0 - crypto.getRandomValues(rawBytes) - } - - // XXX: phantomjs doesn't like a buffer being passed here - var bytes = Buffer.from(rawBytes.buffer) - - if (typeof cb === 'function') { - return process.nextTick(function () { - cb(null, bytes) - }) - } - - return bytes -} diff --git a/node_modules/randombytes/index.js b/node_modules/randombytes/index.js deleted file mode 100644 index a2d9e3911..000000000 --- a/node_modules/randombytes/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('crypto').randomBytes diff --git a/node_modules/randombytes/package.json b/node_modules/randombytes/package.json deleted file mode 100644 index a0415057e..000000000 --- a/node_modules/randombytes/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "randombytes", - "version": "2.0.6", - "description": "random bytes from browserify stand alone", - "main": "index.js", - "scripts": { - "test": "standard && node test.js | tspec", - "phantom": "zuul --phantom -- test.js", - "local": "zuul --local --no-coverage -- test.js" - }, - "repository": { - "type": "git", - "url": "git@github.com:crypto-browserify/randombytes.git" - }, - "keywords": [ - "crypto", - "random" - ], - "author": "", - "license": "MIT", - "bugs": { - "url": "https://github.com/crypto-browserify/randombytes/issues" - }, - "homepage": "https://github.com/crypto-browserify/randombytes", - "browser": "browser.js", - "devDependencies": { - "phantomjs": "^1.9.9", - "standard": "^10.0.2", - "tap-spec": "^2.1.2", - "tape": "^4.6.3", - "zuul": "^3.7.2" - }, - "dependencies": { - "safe-buffer": "^5.1.0" - } -} diff --git a/node_modules/randombytes/test.js b/node_modules/randombytes/test.js deleted file mode 100644 index 8e34dcaa4..000000000 --- a/node_modules/randombytes/test.js +++ /dev/null @@ -1,56 +0,0 @@ -var test = require('tape') -var randomBytes = require('./') - -test('sync', function (t) { - t.plan(4) - t.equals(randomBytes(0).length, 0, 'len: ' + 0) - t.equals(randomBytes(3).length, 3, 'len: ' + 3) - t.equals(randomBytes(30).length, 30, 'len: ' + 30) - t.equals(randomBytes(300).length, 300, 'len: ' + 300) -}) - -test('async', function (t) { - t.plan(4) - - randomBytes(0, function (err, resp) { - if (err) throw err - - t.equals(resp.length, 0, 'len: ' + 0) - }) - - randomBytes(3, function (err, resp) { - if (err) throw err - - t.equals(resp.length, 3, 'len: ' + 3) - }) - - randomBytes(30, function (err, resp) { - if (err) throw err - - t.equals(resp.length, 30, 'len: ' + 30) - }) - - randomBytes(300, function (err, resp) { - if (err) throw err - - t.equals(resp.length, 300, 'len: ' + 300) - }) -}) - -if (process.browser) { - test('requesting to much throws', function (t) { - t.plan(1) - t.throws(function () { - randomBytes(65537) - }) - }) - - test('requesting to much throws async', function (t) { - t.plan(1) - t.throws(function () { - randomBytes(65537, function () { - t.ok(false, 'should not get here') - }) - }) - }) -} |