feat:node-modules
This commit is contained in:
114
node_modules/seedrandom/lib/alea.js
generated
vendored
Normal file
114
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 = String(data);
|
||||
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
node_modules/seedrandom/lib/alea.min.js
generated
vendored
Normal file
1
node_modules/seedrandom/lib/alea.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(n,t,e){function u(n){var t=this,e=function(){var s=4022871197;return function(n){n=String(n);for(var t=0;t<n.length;t++){var e=.02519603282416938*(s+=n.charCodeAt(t));e-=s=e>>>0,s=(e*=s)>>>0,s+=4294967296*(e-=s)}return 2.3283064365386963e-10*(s>>>0)}}();t.next=function(){var n=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=n-(t.c=0|n)},t.c=1,t.s0=e(" "),t.s1=e(" "),t.s2=e(" "),t.s0-=e(n),t.s0<0&&(t.s0+=1),t.s1-=e(n),t.s1<0&&(t.s1+=1),t.s2-=e(n),t.s2<0&&(t.s2+=1),e=null}function o(n,t){return t.c=n.c,t.s0=n.s0,t.s1=n.s1,t.s2=n.s2,t}function s(n,t){var e=new u(n),s=t&&t.state,r=e.next;return r.int32=function(){return 4294967296*e.next()|0},r.double=function(){return r()+11102230246251565e-32*(2097152*r()|0)},r.quick=r,s&&("object"==typeof s&&o(s,e),r.state=function(){return o(e,{})}),r}t&&t.exports?t.exports=s:e&&e.amd?e(function(){return s}):this.alea=s}(0,"object"==typeof module&&module,"function"==typeof define&&define);
|
||||
11
node_modules/seedrandom/lib/crypto.js
generated
vendored
Normal file
11
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
node_modules/seedrandom/lib/tychei.js
generated
vendored
Normal file
103
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
node_modules/seedrandom/lib/tychei.min.js
generated
vendored
Normal file
1
node_modules/seedrandom/lib/tychei.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(t,n,e){function u(t){var r=this,n="";r.next=function(){var t=r.b,n=r.c,e=r.d,o=r.a;return t=t<<25^t>>>7^n,n=n-e|0,e=e<<24^e>>>8^o,o=o-t|0,r.b=t=t<<20^t>>>12^n,r.c=n=n-e|0,r.d=e<<16^n>>>16^o,r.a=o-t|0},r.a=0,r.b=0,r.c=-1640531527,r.d=1367130551,t===Math.floor(t)?(r.a=t/4294967296|0,r.b=0|t):n+=t;for(var e=0;e<n.length+20;e++)r.b^=0|n.charCodeAt(e),r.next()}function c(t,n){return n.a=t.a,n.b=t.b,n.c=t.c,n.d=t.d,n}function o(t,n){function e(){return(o.next()>>>0)/4294967296}var o=new u(t),r=n&&n.state;return e.double=function(){do{var t=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},e.int32=o.next,e.quick=e,r&&("object"==typeof r&&c(r,o),e.state=function(){return c(o,{})}),e}n&&n.exports?n.exports=o:e&&e.amd?e(function(){return o}):this.tychei=o}(0,"object"==typeof module&&module,"function"==typeof define&&define);
|
||||
81
node_modules/seedrandom/lib/xor128.js
generated
vendored
Normal file
81
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
node_modules/seedrandom/lib/xor128.min.js
generated
vendored
Normal file
1
node_modules/seedrandom/lib/xor128.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(t,n,e){function u(t){var n=this,e="";n.x=0,n.y=0,n.z=0,n.w=0,n.next=function(){var t=n.x^n.x<<11;return n.x=n.y,n.y=n.z,n.z=n.w,n.w^=n.w>>>19^t^t>>>8},t===(0|t)?n.x=t:e+=t;for(var o=0;o<e.length+64;o++)n.x^=0|e.charCodeAt(o),n.next()}function i(t,n){return n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n}function o(t,n){function e(){return(o.next()>>>0)/4294967296}var o=new u(t),r=n&&n.state;return e.double=function(){do{var t=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},e.int32=o.next,e.quick=e,r&&("object"==typeof r&&i(r,o),e.state=function(){return i(o,{})}),e}n&&n.exports?n.exports=o:e&&e.amd?e(function(){return o}):this.xor128=o}(0,"object"==typeof module&&module,"function"==typeof define&&define);
|
||||
146
node_modules/seedrandom/lib/xor4096.js
generated
vendored
Normal file
146
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
node_modules/seedrandom/lib/xor4096.min.js
generated
vendored
Normal file
1
node_modules/seedrandom/lib/xor4096.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(n,t,e){function o(n){var o=this;o.next=function(){var n,t,e=o.w,r=o.X,i=o.i;return o.w=e=e+1640531527|0,t=r[i+34&127],n=r[i=i+1&127],t^=t<<13,n^=n<<17,t^=t>>>15,n^=n>>>12,t=r[i]=t^n,o.i=i,t+(e^e>>>16)|0},function(n,t){var e,r,i,o,u,f=[],c=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,c=Math.max(c,t.length)),i=0,o=-32;o<c;++o)t&&(r^=t.charCodeAt((o+32)%t.length)),0===o&&(u=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,0<=o&&(u=u+1640531527|0,i=0==(e=f[127&o]^=r+u)?i+1:0);for(128<=i&&(f[127&(t&&t.length||0)]=-1),i=127,o=512;0<o;--o)r=f[i+34&127],e=f[i=i+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,f[i]=r^e;n.w=u,n.X=f,n.i=i}(o,n)}function u(n,t){return t.i=n.i,t.w=n.w,t.X=n.X.slice(),t}function r(n,t){null==n&&(n=+new Date);function e(){return(r.next()>>>0)/4294967296}var r=new o(n),i=t&&t.state;return e.double=function(){do{var n=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===n);return n},e.int32=r.next,e.quick=e,i&&(i.X&&u(i,r),e.state=function(){return u(r,{})}),e}t&&t.exports?t.exports=r:e&&e.amd?e(function(){return r}):this.xor4096=r}(0,"object"==typeof module&&module,"function"==typeof define&&define);
|
||||
97
node_modules/seedrandom/lib/xorshift7.js
generated
vendored
Normal file
97
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
node_modules/seedrandom/lib/xorshift7.min.js
generated
vendored
Normal file
1
node_modules/seedrandom/lib/xorshift7.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(n,t,e){function o(n){var i=this;i.next=function(){var n,t,e=i.x,r=i.i;return n=e[r],t=(n^=n>>>7)^n<<24,t^=(n=e[r+1&7])^n>>>10,t^=(n=e[r+3&7])^n>>>3,t^=(n=e[r+4&7])^n<<7,n=e[r+7&7],t^=(n^=n<<13)^n<<9,e[r]=t,i.i=r+1&7,t},function(n,t){var e,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,e=0;e<t.length;++e)r[7&e]=r[7&e]<<15^t.charCodeAt(e)+r[e+1&7]<<13;for(;r.length<8;)r.push(0);for(e=0;e<8&&0===r[e];++e);for(8==e?r[7]=-1:r[e],n.x=r,n.i=0,e=256;0<e;--e)n.next()}(i,n)}function u(n,t){return t.x=n.x.slice(),t.i=n.i,t}function r(n,t){null==n&&(n=+new Date);function e(){return(r.next()>>>0)/4294967296}var r=new o(n),i=t&&t.state;return e.double=function(){do{var n=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===n);return n},e.int32=r.next,e.quick=e,i&&(i.x&&u(i,r),e.state=function(){return u(r,{})}),e}t&&t.exports?t.exports=r:e&&e.amd?e(function(){return r}):this.xorshift7=r}(0,"object"==typeof module&&module,"function"==typeof define&&define);
|
||||
86
node_modules/seedrandom/lib/xorwow.js
generated
vendored
Normal file
86
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
node_modules/seedrandom/lib/xorwow.min.js
generated
vendored
Normal file
1
node_modules/seedrandom/lib/xorwow.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(t,n,e){function u(t){var n=this,e="";n.next=function(){var t=n.x^n.x>>>2;return n.x=n.y,n.y=n.z,n.z=n.w,n.w=n.v,(n.d=n.d+362437|0)+(n.v=n.v^n.v<<4^t^t<<1)|0},n.x=0,n.y=0,n.z=0,n.w=0,t===((n.v=0)|t)?n.x=t:e+=t;for(var o=0;o<e.length+64;o++)n.x^=0|e.charCodeAt(o),o==e.length&&(n.d=n.x<<10^n.x>>>4),n.next()}function x(t,n){return n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n.v=t.v,n.d=t.d,n}function o(t,n){function e(){return(o.next()>>>0)/4294967296}var o=new u(t),r=n&&n.state;return e.double=function(){do{var t=((o.next()>>>11)+(o.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},e.int32=o.next,e.quick=e,r&&("object"==typeof r&&x(r,o),e.state=function(){return x(o,{})}),e}n&&n.exports?n.exports=o:e&&e.amd?e(function(){return o}):this.xorwow=o}(0,"object"==typeof module&&module,"function"==typeof define&&define);
|
||||
Reference in New Issue
Block a user