Commit 592b94a9 authored by Bastien ROUCARIÈS's avatar Bastien ROUCARIÈS

New upstream version 2.0.5

parent 92c8f1a5
node_modules
......@@ -2,9 +2,9 @@ sudo: false
language: node_js
matrix:
include:
- node_js: '0.10'
- node_js: '7'
env: TEST_SUITE=test
- node_js: '0.12'
- node_js: '6'
env: TEST_SUITE=test
- node_js: '5'
env: TEST_SUITE=test
......
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.
......@@ -4,6 +4,7 @@ function oldBrowser () {
throw new Error('secure random number generation 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) {
......@@ -23,8 +24,9 @@ function randomBytes (size, cb) {
if (size > 0) { // getRandomValues fails on IE if size == 0
crypto.getRandomValues(rawBytes)
}
// phantomjs doesn't like a buffer being passed here
var bytes = new Buffer(rawBytes.buffer)
// XXX: phantomjs doesn't like a buffer being passed here
var bytes = Buffer.from(rawBytes.buffer)
if (typeof cb === 'function') {
return process.nextTick(function () {
......
{
"name": "randombytes",
"version": "2.0.3",
"version": "2.0.5",
"description": "random bytes from browserify stand alone",
"main": "index.js",
"scripts": {
......@@ -25,9 +25,12 @@
"browser": "browser.js",
"devDependencies": {
"phantomjs": "^1.9.9",
"standard": "^3.3.0",
"standard": "^10.0.2",
"tap-spec": "^2.1.2",
"tape": "^3.0.3",
"tape": "^4.6.3",
"zuul": "^3.7.2"
},
"dependencies": {
"safe-buffer": "^5.1.0"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment