first commit
This commit is contained in:
114
build/node_modules/seedrandom/lib/alea.js
generated
vendored
Normal file
114
build/node_modules/seedrandom/lib/alea.js
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
// A port of an algorithm by Johannes Baagøe <baagoe@baagoe.com>, 2010
|
||||
// http://baagoe.com/en/RandomMusings/javascript/
|
||||
// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror
|
||||
// Original work is under MIT license -
|
||||
|
||||
// Copyright (C) 2010 by Johannes Baagøe <baagoe@baagoe.org>
|
||||
//
|
||||
// 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.
|
||||
|
||||
|
||||
|
||||
(function(global, module, define) {
|
||||
|
||||
function Alea(seed) {
|
||||
var me = this, mash = Mash();
|
||||
|
||||
me.next = function() {
|
||||
var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32
|
||||
me.s0 = me.s1;
|
||||
me.s1 = me.s2;
|
||||
return me.s2 = t - (me.c = t | 0);
|
||||
};
|
||||
|
||||
// Apply the seeding algorithm from Baagoe.
|
||||
me.c = 1;
|
||||
me.s0 = mash(' ');
|
||||
me.s1 = mash(' ');
|
||||
me.s2 = mash(' ');
|
||||
me.s0 -= mash(seed);
|
||||
if (me.s0 < 0) { me.s0 += 1; }
|
||||
me.s1 -= mash(seed);
|
||||
if (me.s1 < 0) { me.s1 += 1; }
|
||||
me.s2 -= mash(seed);
|
||||
if (me.s2 < 0) { me.s2 += 1; }
|
||||
mash = null;
|
||||
}
|
||||
|
||||
function copy(f, t) {
|
||||
t.c = f.c;
|
||||
t.s0 = f.s0;
|
||||
t.s1 = f.s1;
|
||||
t.s2 = f.s2;
|
||||
return t;
|
||||
}
|
||||
|
||||
function impl(seed, opts) {
|
||||
var xg = new Alea(seed),
|
||||
state = opts && opts.state,
|
||||
prng = xg.next;
|
||||
prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }
|
||||
prng.double = function() {
|
||||
return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53
|
||||
};
|
||||
prng.quick = prng;
|
||||
if (state) {
|
||||
if (typeof(state) == 'object') copy(state, xg);
|
||||
prng.state = function() { return copy(xg, {}); }
|
||||
}
|
||||
return prng;
|
||||
}
|
||||
|
||||
function Mash() {
|
||||
var n = 0xefc8249d;
|
||||
|
||||
var mash = function(data) {
|
||||
data = data.toString();
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
n += data.charCodeAt(i);
|
||||
var h = 0.02519603282416938 * n;
|
||||
n = h >>> 0;
|
||||
h -= n;
|
||||
h *= n;
|
||||
n = h >>> 0;
|
||||
h -= n;
|
||||
n += h * 0x100000000; // 2^32
|
||||
}
|
||||
return (n >>> 0) * 2.3283064365386963e-10; // 2^-32
|
||||
};
|
||||
|
||||
return mash;
|
||||
}
|
||||
|
||||
|
||||
if (module && module.exports) {
|
||||
module.exports = impl;
|
||||
} else if (define && define.amd) {
|
||||
define(function() { return impl; });
|
||||
} else {
|
||||
this.alea = impl;
|
||||
}
|
||||
|
||||
})(
|
||||
this,
|
||||
(typeof module) == 'object' && module, // present in node.js
|
||||
(typeof define) == 'function' && define // present with an AMD loader
|
||||
);
|
||||
|
||||
|
||||
1
build/node_modules/seedrandom/lib/alea.min.js
generated
vendored
Normal file
1
build/node_modules/seedrandom/lib/alea.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(a,b,c){function d(a){var b=this,c=g();b.next=function(){var a=2091639*b.s0+2.3283064365386963e-10*b.c;return b.s0=b.s1,b.s1=b.s2,b.s2=a-(b.c=0|a)},b.c=1,b.s0=c(" "),b.s1=c(" "),b.s2=c(" "),b.s0-=c(a),b.s0<0&&(b.s0+=1),b.s1-=c(a),b.s1<0&&(b.s1+=1),b.s2-=c(a),b.s2<0&&(b.s2+=1),c=null}function e(a,b){return b.c=a.c,b.s0=a.s0,b.s1=a.s1,b.s2=a.s2,b}function f(a,b){var c=new d(a),f=b&&b.state,g=c.next;return g.int32=function(){return 4294967296*c.next()|0},g.double=function(){return g()+1.1102230246251565e-16*(2097152*g()|0)},g.quick=g,f&&("object"==typeof f&&e(f,c),g.state=function(){return e(c,{})}),g}function g(){var a=4022871197,b=function(b){b=b.toString();for(var c=0;c<b.length;c++){a+=b.charCodeAt(c);var d=.02519603282416938*a;a=d>>>0,d-=a,d*=a,a=d>>>0,d-=a,a+=4294967296*d}return 2.3283064365386963e-10*(a>>>0)};return b}b&&b.exports?b.exports=f:c&&c.amd?c(function(){return f}):this.alea=f}(this,"object"==typeof module&&module,"function"==typeof define&&define);
|
||||
11
build/node_modules/seedrandom/lib/crypto.js
generated
vendored
Normal file
11
build/node_modules/seedrandom/lib/crypto.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
// mimic a subset of node's crypto API for the browser
|
||||
|
||||
function randomBytes(width) {
|
||||
var out = new Uint8Array(width);
|
||||
(global.crypto || global.msCrypto).getRandomValues(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
randomBytes: randomBytes
|
||||
}
|
||||
103
build/node_modules/seedrandom/lib/tychei.js
generated
vendored
Normal file
103
build/node_modules/seedrandom/lib/tychei.js
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
// A Javascript implementaion of the "Tyche-i" prng algorithm by
|
||||
// Samuel Neves and Filipe Araujo.
|
||||
// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf
|
||||
|
||||
(function(global, module, define) {
|
||||
|
||||
function XorGen(seed) {
|
||||
var me = this, strseed = '';
|
||||
|
||||
// Set up generator function.
|
||||
me.next = function() {
|
||||
var b = me.b, c = me.c, d = me.d, a = me.a;
|
||||
b = (b << 25) ^ (b >>> 7) ^ c;
|
||||
c = (c - d) | 0;
|
||||
d = (d << 24) ^ (d >>> 8) ^ a;
|
||||
a = (a - b) | 0;
|
||||
me.b = b = (b << 20) ^ (b >>> 12) ^ c;
|
||||
me.c = c = (c - d) | 0;
|
||||
me.d = (d << 16) ^ (c >>> 16) ^ a;
|
||||
return me.a = (a - b) | 0;
|
||||
};
|
||||
|
||||
/* The following is non-inverted tyche, which has better internal
|
||||
* bit diffusion, but which is about 25% slower than tyche-i in JS.
|
||||
me.next = function() {
|
||||
var a = me.a, b = me.b, c = me.c, d = me.d;
|
||||
a = (me.a + me.b | 0) >>> 0;
|
||||
d = me.d ^ a; d = d << 16 ^ d >>> 16;
|
||||
c = me.c + d | 0;
|
||||
b = me.b ^ c; b = b << 12 ^ d >>> 20;
|
||||
me.a = a = a + b | 0;
|
||||
d = d ^ a; me.d = d = d << 8 ^ d >>> 24;
|
||||
me.c = c = c + d | 0;
|
||||
b = b ^ c;
|
||||
return me.b = (b << 7 ^ b >>> 25);
|
||||
}
|
||||
*/
|
||||
|
||||
me.a = 0;
|
||||
me.b = 0;
|
||||
me.c = 2654435769 | 0;
|
||||
me.d = 1367130551;
|
||||
|
||||
if (seed === Math.floor(seed)) {
|
||||
// Integer seed.
|
||||
me.a = (seed / 0x100000000) | 0;
|
||||
me.b = seed | 0;
|
||||
} else {
|
||||
// String seed.
|
||||
strseed += seed;
|
||||
}
|
||||
|
||||
// Mix in string seed, then discard an initial batch of 64 values.
|
||||
for (var k = 0; k < strseed.length + 20; k++) {
|
||||
me.b ^= strseed.charCodeAt(k) | 0;
|
||||
me.next();
|
||||
}
|
||||
}
|
||||
|
||||
function copy(f, t) {
|
||||
t.a = f.a;
|
||||
t.b = f.b;
|
||||
t.c = f.c;
|
||||
t.d = f.d;
|
||||
return t;
|
||||
};
|
||||
|
||||
function impl(seed, opts) {
|
||||
var xg = new XorGen(seed),
|
||||
state = opts && opts.state,
|
||||
prng = function() { return (xg.next() >>> 0) / 0x100000000; };
|
||||
prng.double = function() {
|
||||
do {
|
||||
var top = xg.next() >>> 11,
|
||||
bot = (xg.next() >>> 0) / 0x100000000,
|
||||
result = (top + bot) / (1 << 21);
|
||||
} while (result === 0);
|
||||
return result;
|
||||
};
|
||||
prng.int32 = xg.next;
|
||||
prng.quick = prng;
|
||||
if (state) {
|
||||
if (typeof(state) == 'object') copy(state, xg);
|
||||
prng.state = function() { return copy(xg, {}); }
|
||||
}
|
||||
return prng;
|
||||
}
|
||||
|
||||
if (module && module.exports) {
|
||||
module.exports = impl;
|
||||
} else if (define && define.amd) {
|
||||
define(function() { return impl; });
|
||||
} else {
|
||||
this.tychei = impl;
|
||||
}
|
||||
|
||||
})(
|
||||
this,
|
||||
(typeof module) == 'object' && module, // present in node.js
|
||||
(typeof define) == 'function' && define // present with an AMD loader
|
||||
);
|
||||
|
||||
|
||||
1
build/node_modules/seedrandom/lib/tychei.min.js
generated
vendored
Normal file
1
build/node_modules/seedrandom/lib/tychei.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(a,b,c){function d(a){var b=this,c="";b.next=function(){var a=b.b,c=b.c,d=b.d,e=b.a;return a=a<<25^a>>>7^c,c=c-d|0,d=d<<24^d>>>8^e,e=e-a|0,b.b=a=a<<20^a>>>12^c,b.c=c=c-d|0,b.d=d<<16^c>>>16^e,b.a=e-a|0},b.a=0,b.b=0,b.c=-1640531527,b.d=1367130551,a===Math.floor(a)?(b.a=a/4294967296|0,b.b=0|a):c+=a;for(var d=0;d<c.length+20;d++)b.b^=0|c.charCodeAt(d),b.next()}function e(a,b){return b.a=a.a,b.b=a.b,b.c=a.c,b.d=a.d,b}function f(a,b){var c=new d(a),f=b&&b.state,g=function(){return(c.next()>>>0)/4294967296};return g.double=function(){do var a=c.next()>>>11,b=(c.next()>>>0)/4294967296,d=(a+b)/(1<<21);while(0===d);return d},g.int32=c.next,g.quick=g,f&&("object"==typeof f&&e(f,c),g.state=function(){return e(c,{})}),g}b&&b.exports?b.exports=f:c&&c.amd?c(function(){return f}):this.tychei=f}(this,"object"==typeof module&&module,"function"==typeof define&&define);
|
||||
81
build/node_modules/seedrandom/lib/xor128.js
generated
vendored
Normal file
81
build/node_modules/seedrandom/lib/xor128.js
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
// A Javascript implementaion of the "xor128" prng algorithm by
|
||||
// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper
|
||||
|
||||
(function(global, module, define) {
|
||||
|
||||
function XorGen(seed) {
|
||||
var me = this, strseed = '';
|
||||
|
||||
me.x = 0;
|
||||
me.y = 0;
|
||||
me.z = 0;
|
||||
me.w = 0;
|
||||
|
||||
// Set up generator function.
|
||||
me.next = function() {
|
||||
var t = me.x ^ (me.x << 11);
|
||||
me.x = me.y;
|
||||
me.y = me.z;
|
||||
me.z = me.w;
|
||||
return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);
|
||||
};
|
||||
|
||||
if (seed === (seed | 0)) {
|
||||
// Integer seed.
|
||||
me.x = seed;
|
||||
} else {
|
||||
// String seed.
|
||||
strseed += seed;
|
||||
}
|
||||
|
||||
// Mix in string seed, then discard an initial batch of 64 values.
|
||||
for (var k = 0; k < strseed.length + 64; k++) {
|
||||
me.x ^= strseed.charCodeAt(k) | 0;
|
||||
me.next();
|
||||
}
|
||||
}
|
||||
|
||||
function copy(f, t) {
|
||||
t.x = f.x;
|
||||
t.y = f.y;
|
||||
t.z = f.z;
|
||||
t.w = f.w;
|
||||
return t;
|
||||
}
|
||||
|
||||
function impl(seed, opts) {
|
||||
var xg = new XorGen(seed),
|
||||
state = opts && opts.state,
|
||||
prng = function() { return (xg.next() >>> 0) / 0x100000000; };
|
||||
prng.double = function() {
|
||||
do {
|
||||
var top = xg.next() >>> 11,
|
||||
bot = (xg.next() >>> 0) / 0x100000000,
|
||||
result = (top + bot) / (1 << 21);
|
||||
} while (result === 0);
|
||||
return result;
|
||||
};
|
||||
prng.int32 = xg.next;
|
||||
prng.quick = prng;
|
||||
if (state) {
|
||||
if (typeof(state) == 'object') copy(state, xg);
|
||||
prng.state = function() { return copy(xg, {}); }
|
||||
}
|
||||
return prng;
|
||||
}
|
||||
|
||||
if (module && module.exports) {
|
||||
module.exports = impl;
|
||||
} else if (define && define.amd) {
|
||||
define(function() { return impl; });
|
||||
} else {
|
||||
this.xor128 = impl;
|
||||
}
|
||||
|
||||
})(
|
||||
this,
|
||||
(typeof module) == 'object' && module, // present in node.js
|
||||
(typeof define) == 'function' && define // present with an AMD loader
|
||||
);
|
||||
|
||||
|
||||
1
build/node_modules/seedrandom/lib/xor128.min.js
generated
vendored
Normal file
1
build/node_modules/seedrandom/lib/xor128.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(a,b,c){function d(a){var b=this,c="";b.x=0,b.y=0,b.z=0,b.w=0,b.next=function(){var a=b.x^b.x<<11;return b.x=b.y,b.y=b.z,b.z=b.w,b.w^=b.w>>>19^a^a>>>8},a===(0|a)?b.x=a:c+=a;for(var d=0;d<c.length+64;d++)b.x^=0|c.charCodeAt(d),b.next()}function e(a,b){return b.x=a.x,b.y=a.y,b.z=a.z,b.w=a.w,b}function f(a,b){var c=new d(a),f=b&&b.state,g=function(){return(c.next()>>>0)/4294967296};return g.double=function(){do var a=c.next()>>>11,b=(c.next()>>>0)/4294967296,d=(a+b)/(1<<21);while(0===d);return d},g.int32=c.next,g.quick=g,f&&("object"==typeof f&&e(f,c),g.state=function(){return e(c,{})}),g}b&&b.exports?b.exports=f:c&&c.amd?c(function(){return f}):this.xor128=f}(this,"object"==typeof module&&module,"function"==typeof define&&define);
|
||||
146
build/node_modules/seedrandom/lib/xor4096.js
generated
vendored
Normal file
146
build/node_modules/seedrandom/lib/xor4096.js
generated
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.
|
||||
//
|
||||
// This fast non-cryptographic random number generator is designed for
|
||||
// use in Monte-Carlo algorithms. It combines a long-period xorshift
|
||||
// generator with a Weyl generator, and it passes all common batteries
|
||||
// of stasticial tests for randomness while consuming only a few nanoseconds
|
||||
// for each prng generated. For background on the generator, see Brent's
|
||||
// paper: "Some long-period random number generators using shifts and xors."
|
||||
// http://arxiv.org/pdf/1004.3115v1.pdf
|
||||
//
|
||||
// Usage:
|
||||
//
|
||||
// var xor4096 = require('xor4096');
|
||||
// random = xor4096(1); // Seed with int32 or string.
|
||||
// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.
|
||||
// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.
|
||||
//
|
||||
// For nonzero numeric keys, this impelementation provides a sequence
|
||||
// identical to that by Brent's xorgens 3 implementaion in C. This
|
||||
// implementation also provides for initalizing the generator with
|
||||
// string seeds, or for saving and restoring the state of the generator.
|
||||
//
|
||||
// On Chrome, this prng benchmarks about 2.1 times slower than
|
||||
// Javascript's built-in Math.random().
|
||||
|
||||
(function(global, module, define) {
|
||||
|
||||
function XorGen(seed) {
|
||||
var me = this;
|
||||
|
||||
// Set up generator function.
|
||||
me.next = function() {
|
||||
var w = me.w,
|
||||
X = me.X, i = me.i, t, v;
|
||||
// Update Weyl generator.
|
||||
me.w = w = (w + 0x61c88647) | 0;
|
||||
// Update xor generator.
|
||||
v = X[(i + 34) & 127];
|
||||
t = X[i = ((i + 1) & 127)];
|
||||
v ^= v << 13;
|
||||
t ^= t << 17;
|
||||
v ^= v >>> 15;
|
||||
t ^= t >>> 12;
|
||||
// Update Xor generator array state.
|
||||
v = X[i] = v ^ t;
|
||||
me.i = i;
|
||||
// Result is the combination.
|
||||
return (v + (w ^ (w >>> 16))) | 0;
|
||||
};
|
||||
|
||||
function init(me, seed) {
|
||||
var t, v, i, j, w, X = [], limit = 128;
|
||||
if (seed === (seed | 0)) {
|
||||
// Numeric seeds initialize v, which is used to generates X.
|
||||
v = seed;
|
||||
seed = null;
|
||||
} else {
|
||||
// String seeds are mixed into v and X one character at a time.
|
||||
seed = seed + '\0';
|
||||
v = 0;
|
||||
limit = Math.max(limit, seed.length);
|
||||
}
|
||||
// Initialize circular array and weyl value.
|
||||
for (i = 0, j = -32; j < limit; ++j) {
|
||||
// Put the unicode characters into the array, and shuffle them.
|
||||
if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);
|
||||
// After 32 shuffles, take v as the starting w value.
|
||||
if (j === 0) w = v;
|
||||
v ^= v << 10;
|
||||
v ^= v >>> 15;
|
||||
v ^= v << 4;
|
||||
v ^= v >>> 13;
|
||||
if (j >= 0) {
|
||||
w = (w + 0x61c88647) | 0; // Weyl.
|
||||
t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.
|
||||
i = (0 == t) ? i + 1 : 0; // Count zeroes.
|
||||
}
|
||||
}
|
||||
// We have detected all zeroes; make the key nonzero.
|
||||
if (i >= 128) {
|
||||
X[(seed && seed.length || 0) & 127] = -1;
|
||||
}
|
||||
// Run the generator 512 times to further mix the state before using it.
|
||||
// Factoring this as a function slows the main generator, so it is just
|
||||
// unrolled here. The weyl generator is not advanced while warming up.
|
||||
i = 127;
|
||||
for (j = 4 * 128; j > 0; --j) {
|
||||
v = X[(i + 34) & 127];
|
||||
t = X[i = ((i + 1) & 127)];
|
||||
v ^= v << 13;
|
||||
t ^= t << 17;
|
||||
v ^= v >>> 15;
|
||||
t ^= t >>> 12;
|
||||
X[i] = v ^ t;
|
||||
}
|
||||
// Storing state as object members is faster than using closure variables.
|
||||
me.w = w;
|
||||
me.X = X;
|
||||
me.i = i;
|
||||
}
|
||||
|
||||
init(me, seed);
|
||||
}
|
||||
|
||||
function copy(f, t) {
|
||||
t.i = f.i;
|
||||
t.w = f.w;
|
||||
t.X = f.X.slice();
|
||||
return t;
|
||||
};
|
||||
|
||||
function impl(seed, opts) {
|
||||
if (seed == null) seed = +(new Date);
|
||||
var xg = new XorGen(seed),
|
||||
state = opts && opts.state,
|
||||
prng = function() { return (xg.next() >>> 0) / 0x100000000; };
|
||||
prng.double = function() {
|
||||
do {
|
||||
var top = xg.next() >>> 11,
|
||||
bot = (xg.next() >>> 0) / 0x100000000,
|
||||
result = (top + bot) / (1 << 21);
|
||||
} while (result === 0);
|
||||
return result;
|
||||
};
|
||||
prng.int32 = xg.next;
|
||||
prng.quick = prng;
|
||||
if (state) {
|
||||
if (state.X) copy(state, xg);
|
||||
prng.state = function() { return copy(xg, {}); }
|
||||
}
|
||||
return prng;
|
||||
}
|
||||
|
||||
if (module && module.exports) {
|
||||
module.exports = impl;
|
||||
} else if (define && define.amd) {
|
||||
define(function() { return impl; });
|
||||
} else {
|
||||
this.xor4096 = impl;
|
||||
}
|
||||
|
||||
})(
|
||||
this, // window object or global
|
||||
(typeof module) == 'object' && module, // present in node.js
|
||||
(typeof define) == 'function' && define // present with an AMD loader
|
||||
);
|
||||
1
build/node_modules/seedrandom/lib/xor4096.min.js
generated
vendored
Normal file
1
build/node_modules/seedrandom/lib/xor4096.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(a,b,c){function d(a){function b(a,b){var c,d,e,f,g,h=[],i=128;for(b===(0|b)?(d=b,b=null):(b+="\0",d=0,i=Math.max(i,b.length)),e=0,f=-32;f<i;++f)b&&(d^=b.charCodeAt((f+32)%b.length)),0===f&&(g=d),d^=d<<10,d^=d>>>15,d^=d<<4,d^=d>>>13,f>=0&&(g=g+1640531527|0,c=h[127&f]^=d+g,e=0==c?e+1:0);for(e>=128&&(h[127&(b&&b.length||0)]=-1),e=127,f=512;f>0;--f)d=h[e+34&127],c=h[e=e+1&127],d^=d<<13,c^=c<<17,d^=d>>>15,c^=c>>>12,h[e]=d^c;a.w=g,a.X=h,a.i=e}var c=this;c.next=function(){var a,b,d=c.w,e=c.X,f=c.i;return c.w=d=d+1640531527|0,b=e[f+34&127],a=e[f=f+1&127],b^=b<<13,a^=a<<17,b^=b>>>15,a^=a>>>12,b=e[f]=b^a,c.i=f,b+(d^d>>>16)|0},b(c,a)}function e(a,b){return b.i=a.i,b.w=a.w,b.X=a.X.slice(),b}function f(a,b){null==a&&(a=+new Date);var c=new d(a),f=b&&b.state,g=function(){return(c.next()>>>0)/4294967296};return g.double=function(){do var a=c.next()>>>11,b=(c.next()>>>0)/4294967296,d=(a+b)/(1<<21);while(0===d);return d},g.int32=c.next,g.quick=g,f&&(f.X&&e(f,c),g.state=function(){return e(c,{})}),g}b&&b.exports?b.exports=f:c&&c.amd?c(function(){return f}):this.xor4096=f}(this,"object"==typeof module&&module,"function"==typeof define&&define);
|
||||
97
build/node_modules/seedrandom/lib/xorshift7.js
generated
vendored
Normal file
97
build/node_modules/seedrandom/lib/xorshift7.js
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
// A Javascript implementaion of the "xorshift7" algorithm by
|
||||
// François Panneton and Pierre L'ecuyer:
|
||||
// "On the Xorgshift Random Number Generators"
|
||||
// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf
|
||||
|
||||
(function(global, module, define) {
|
||||
|
||||
function XorGen(seed) {
|
||||
var me = this;
|
||||
|
||||
// Set up generator function.
|
||||
me.next = function() {
|
||||
// Update xor generator.
|
||||
var X = me.x, i = me.i, t, v, w;
|
||||
t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);
|
||||
t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);
|
||||
t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);
|
||||
t = X[(i + 4) & 7]; v ^= t ^ (t << 7);
|
||||
t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);
|
||||
X[i] = v;
|
||||
me.i = (i + 1) & 7;
|
||||
return v;
|
||||
};
|
||||
|
||||
function init(me, seed) {
|
||||
var j, w, X = [];
|
||||
|
||||
if (seed === (seed | 0)) {
|
||||
// Seed state array using a 32-bit integer.
|
||||
w = X[0] = seed;
|
||||
} else {
|
||||
// Seed state using a string.
|
||||
seed = '' + seed;
|
||||
for (j = 0; j < seed.length; ++j) {
|
||||
X[j & 7] = (X[j & 7] << 15) ^
|
||||
(seed.charCodeAt(j) + X[(j + 1) & 7] << 13);
|
||||
}
|
||||
}
|
||||
// Enforce an array length of 8, not all zeroes.
|
||||
while (X.length < 8) X.push(0);
|
||||
for (j = 0; j < 8 && X[j] === 0; ++j);
|
||||
if (j == 8) w = X[7] = -1; else w = X[j];
|
||||
|
||||
me.x = X;
|
||||
me.i = 0;
|
||||
|
||||
// Discard an initial 256 values.
|
||||
for (j = 256; j > 0; --j) {
|
||||
me.next();
|
||||
}
|
||||
}
|
||||
|
||||
init(me, seed);
|
||||
}
|
||||
|
||||
function copy(f, t) {
|
||||
t.x = f.x.slice();
|
||||
t.i = f.i;
|
||||
return t;
|
||||
}
|
||||
|
||||
function impl(seed, opts) {
|
||||
if (seed == null) seed = +(new Date);
|
||||
var xg = new XorGen(seed),
|
||||
state = opts && opts.state,
|
||||
prng = function() { return (xg.next() >>> 0) / 0x100000000; };
|
||||
prng.double = function() {
|
||||
do {
|
||||
var top = xg.next() >>> 11,
|
||||
bot = (xg.next() >>> 0) / 0x100000000,
|
||||
result = (top + bot) / (1 << 21);
|
||||
} while (result === 0);
|
||||
return result;
|
||||
};
|
||||
prng.int32 = xg.next;
|
||||
prng.quick = prng;
|
||||
if (state) {
|
||||
if (state.x) copy(state, xg);
|
||||
prng.state = function() { return copy(xg, {}); }
|
||||
}
|
||||
return prng;
|
||||
}
|
||||
|
||||
if (module && module.exports) {
|
||||
module.exports = impl;
|
||||
} else if (define && define.amd) {
|
||||
define(function() { return impl; });
|
||||
} else {
|
||||
this.xorshift7 = impl;
|
||||
}
|
||||
|
||||
})(
|
||||
this,
|
||||
(typeof module) == 'object' && module, // present in node.js
|
||||
(typeof define) == 'function' && define // present with an AMD loader
|
||||
);
|
||||
|
||||
1
build/node_modules/seedrandom/lib/xorshift7.min.js
generated
vendored
Normal file
1
build/node_modules/seedrandom/lib/xorshift7.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(a,b,c){function d(a){function b(a,b){var c,d,e=[];if(b===(0|b))d=e[0]=b;else for(b=""+b,c=0;c<b.length;++c)e[7&c]=e[7&c]<<15^b.charCodeAt(c)+e[c+1&7]<<13;for(;e.length<8;)e.push(0);for(c=0;c<8&&0===e[c];++c);for(d=8==c?e[7]=-1:e[c],a.x=e,a.i=0,c=256;c>0;--c)a.next()}var c=this;c.next=function(){var a,b,d=c.x,e=c.i;return a=d[e],a^=a>>>7,b=a^a<<24,a=d[e+1&7],b^=a^a>>>10,a=d[e+3&7],b^=a^a>>>3,a=d[e+4&7],b^=a^a<<7,a=d[e+7&7],a^=a<<13,b^=a^a<<9,d[e]=b,c.i=e+1&7,b},b(c,a)}function e(a,b){return b.x=a.x.slice(),b.i=a.i,b}function f(a,b){null==a&&(a=+new Date);var c=new d(a),f=b&&b.state,g=function(){return(c.next()>>>0)/4294967296};return g.double=function(){do var a=c.next()>>>11,b=(c.next()>>>0)/4294967296,d=(a+b)/(1<<21);while(0===d);return d},g.int32=c.next,g.quick=g,f&&(f.x&&e(f,c),g.state=function(){return e(c,{})}),g}b&&b.exports?b.exports=f:c&&c.amd?c(function(){return f}):this.xorshift7=f}(this,"object"==typeof module&&module,"function"==typeof define&&define);
|
||||
86
build/node_modules/seedrandom/lib/xorwow.js
generated
vendored
Normal file
86
build/node_modules/seedrandom/lib/xorwow.js
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
// A Javascript implementaion of the "xorwow" prng algorithm by
|
||||
// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper
|
||||
|
||||
(function(global, module, define) {
|
||||
|
||||
function XorGen(seed) {
|
||||
var me = this, strseed = '';
|
||||
|
||||
// Set up generator function.
|
||||
me.next = function() {
|
||||
var t = (me.x ^ (me.x >>> 2));
|
||||
me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;
|
||||
return (me.d = (me.d + 362437 | 0)) +
|
||||
(me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;
|
||||
};
|
||||
|
||||
me.x = 0;
|
||||
me.y = 0;
|
||||
me.z = 0;
|
||||
me.w = 0;
|
||||
me.v = 0;
|
||||
|
||||
if (seed === (seed | 0)) {
|
||||
// Integer seed.
|
||||
me.x = seed;
|
||||
} else {
|
||||
// String seed.
|
||||
strseed += seed;
|
||||
}
|
||||
|
||||
// Mix in string seed, then discard an initial batch of 64 values.
|
||||
for (var k = 0; k < strseed.length + 64; k++) {
|
||||
me.x ^= strseed.charCodeAt(k) | 0;
|
||||
if (k == strseed.length) {
|
||||
me.d = me.x << 10 ^ me.x >>> 4;
|
||||
}
|
||||
me.next();
|
||||
}
|
||||
}
|
||||
|
||||
function copy(f, t) {
|
||||
t.x = f.x;
|
||||
t.y = f.y;
|
||||
t.z = f.z;
|
||||
t.w = f.w;
|
||||
t.v = f.v;
|
||||
t.d = f.d;
|
||||
return t;
|
||||
}
|
||||
|
||||
function impl(seed, opts) {
|
||||
var xg = new XorGen(seed),
|
||||
state = opts && opts.state,
|
||||
prng = function() { return (xg.next() >>> 0) / 0x100000000; };
|
||||
prng.double = function() {
|
||||
do {
|
||||
var top = xg.next() >>> 11,
|
||||
bot = (xg.next() >>> 0) / 0x100000000,
|
||||
result = (top + bot) / (1 << 21);
|
||||
} while (result === 0);
|
||||
return result;
|
||||
};
|
||||
prng.int32 = xg.next;
|
||||
prng.quick = prng;
|
||||
if (state) {
|
||||
if (typeof(state) == 'object') copy(state, xg);
|
||||
prng.state = function() { return copy(xg, {}); }
|
||||
}
|
||||
return prng;
|
||||
}
|
||||
|
||||
if (module && module.exports) {
|
||||
module.exports = impl;
|
||||
} else if (define && define.amd) {
|
||||
define(function() { return impl; });
|
||||
} else {
|
||||
this.xorwow = impl;
|
||||
}
|
||||
|
||||
})(
|
||||
this,
|
||||
(typeof module) == 'object' && module, // present in node.js
|
||||
(typeof define) == 'function' && define // present with an AMD loader
|
||||
);
|
||||
|
||||
|
||||
1
build/node_modules/seedrandom/lib/xorwow.min.js
generated
vendored
Normal file
1
build/node_modules/seedrandom/lib/xorwow.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(a,b,c){function d(a){var b=this,c="";b.next=function(){var a=b.x^b.x>>>2;return b.x=b.y,b.y=b.z,b.z=b.w,b.w=b.v,(b.d=b.d+362437|0)+(b.v=b.v^b.v<<4^(a^a<<1))|0},b.x=0,b.y=0,b.z=0,b.w=0,b.v=0,a===(0|a)?b.x=a:c+=a;for(var d=0;d<c.length+64;d++)b.x^=0|c.charCodeAt(d),d==c.length&&(b.d=b.x<<10^b.x>>>4),b.next()}function e(a,b){return b.x=a.x,b.y=a.y,b.z=a.z,b.w=a.w,b.v=a.v,b.d=a.d,b}function f(a,b){var c=new d(a),f=b&&b.state,g=function(){return(c.next()>>>0)/4294967296};return g.double=function(){do var a=c.next()>>>11,b=(c.next()>>>0)/4294967296,d=(a+b)/(1<<21);while(0===d);return d},g.int32=c.next,g.quick=g,f&&("object"==typeof f&&e(f,c),g.state=function(){return e(c,{})}),g}b&&b.exports?b.exports=f:c&&c.amd?c(function(){return f}):this.xorwow=f}(this,"object"==typeof module&&module,"function"==typeof define&&define);
|
||||
Reference in New Issue
Block a user