mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-02 14:12:19 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
2
web/node_modules/brorand/.npmignore
generated
vendored
Normal file
2
web/node_modules/brorand/.npmignore
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
node_modules/
|
||||
npm-debug.log
|
26
web/node_modules/brorand/README.md
generated
vendored
Normal file
26
web/node_modules/brorand/README.md
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
# Brorand
|
||||
|
||||
#### LICENSE
|
||||
|
||||
This software is licensed under the MIT License.
|
||||
|
||||
Copyright Fedor Indutny, 2014.
|
||||
|
||||
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.
|
65
web/node_modules/brorand/index.js
generated
vendored
Normal file
65
web/node_modules/brorand/index.js
generated
vendored
Normal file
|
@ -0,0 +1,65 @@
|
|||
var r;
|
||||
|
||||
module.exports = function rand(len) {
|
||||
if (!r)
|
||||
r = new Rand(null);
|
||||
|
||||
return r.generate(len);
|
||||
};
|
||||
|
||||
function Rand(rand) {
|
||||
this.rand = rand;
|
||||
}
|
||||
module.exports.Rand = Rand;
|
||||
|
||||
Rand.prototype.generate = function generate(len) {
|
||||
return this._rand(len);
|
||||
};
|
||||
|
||||
// Emulate crypto API using randy
|
||||
Rand.prototype._rand = function _rand(n) {
|
||||
if (this.rand.getBytes)
|
||||
return this.rand.getBytes(n);
|
||||
|
||||
var res = new Uint8Array(n);
|
||||
for (var i = 0; i < res.length; i++)
|
||||
res[i] = this.rand.getByte();
|
||||
return res;
|
||||
};
|
||||
|
||||
if (typeof self === 'object') {
|
||||
if (self.crypto && self.crypto.getRandomValues) {
|
||||
// Modern browsers
|
||||
Rand.prototype._rand = function _rand(n) {
|
||||
var arr = new Uint8Array(n);
|
||||
self.crypto.getRandomValues(arr);
|
||||
return arr;
|
||||
};
|
||||
} else if (self.msCrypto && self.msCrypto.getRandomValues) {
|
||||
// IE
|
||||
Rand.prototype._rand = function _rand(n) {
|
||||
var arr = new Uint8Array(n);
|
||||
self.msCrypto.getRandomValues(arr);
|
||||
return arr;
|
||||
};
|
||||
|
||||
// Safari's WebWorkers do not have `crypto`
|
||||
} else if (typeof window === 'object') {
|
||||
// Old junk
|
||||
Rand.prototype._rand = function() {
|
||||
throw new Error('Not implemented yet');
|
||||
};
|
||||
}
|
||||
} else {
|
||||
// Node.js or Web worker with no crypto support
|
||||
try {
|
||||
var crypto = require('crypto');
|
||||
if (typeof crypto.randomBytes !== 'function')
|
||||
throw new Error('Not supported');
|
||||
|
||||
Rand.prototype._rand = function _rand(n) {
|
||||
return crypto.randomBytes(n);
|
||||
};
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
31
web/node_modules/brorand/package.json
generated
vendored
Normal file
31
web/node_modules/brorand/package.json
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"name": "brorand",
|
||||
"version": "1.1.0",
|
||||
"description": "Random number generator for browsers and node.js",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "mocha --reporter=spec test/**/*-test.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:indutny/brorand"
|
||||
},
|
||||
"keywords": [
|
||||
"Random",
|
||||
"RNG",
|
||||
"browser",
|
||||
"crypto"
|
||||
],
|
||||
"author": "Fedor Indutny <fedor@indutny.com>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/indutny/brorand/issues"
|
||||
},
|
||||
"homepage": "https://github.com/indutny/brorand",
|
||||
"devDependencies": {
|
||||
"mocha": "^2.0.1"
|
||||
},
|
||||
"browser": {
|
||||
"crypto": false
|
||||
}
|
||||
}
|
8
web/node_modules/brorand/test/api-test.js
generated
vendored
Normal file
8
web/node_modules/brorand/test/api-test.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
var brorand = require('../');
|
||||
var assert = require('assert');
|
||||
|
||||
describe('Brorand', function() {
|
||||
it('should generate random numbers', function() {
|
||||
assert.equal(brorand(100).length, 100);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue