idk anymore

This commit is contained in:
max 2023-03-31 03:22:50 +00:00
parent 8b0ed2c36f
commit 4164a9f836
194 changed files with 977404 additions and 7 deletions

2
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,2 @@
{
}

18
bot.js
View file

@ -13,16 +13,26 @@ const masto = await login({
console.log("selfcarebot starting...");
const M = await masto.v1.statuses.create ({
status: 'Testing; coming soon! 🌸',
const data1 = fspkg.readFile('dataset1.json', 'utf8', (error, data) => {
if (error){
console.log(error);
return;
}
console.log(JSON.parse(data));
})
const status = await masto.v1.statuses.create ({
status: `${data1} selfcare! 🌸`,
visibility: 'public',
});
M.post('statuses', (error, data) => {
console.log('masto.v1.statuses', 'utf8', (error, data) => {
if (error) {
console.error(error);
} else {
fs.writeFileSync('data.json', JSON.stringify(data, null, 2));
fspkg.writeFileSync('data.json',JSON.stringify(data, null, 2));
console.log(data);
}
}

34
bot2.js Normal file
View file

@ -0,0 +1,34 @@
import * as dotenv from 'dotenv';
dotenv.config();
import { login } from 'masto';
import expresspkg from 'express';
const { jsonContent } = expresspkg;
import * as fspkg from 'fs';
const { fs } = fspkg;
console.log("selfcarebot is starting...");
const masto = await login({
url: process.env.URL,
accessToken: process.env.ACCESS_TOKEN,
});
const jsonData = JSON.parse(fspkg.readFileSync('dataset1.json', 'utf-8', (error, data, status) => {
if (error){
console.log(error);
return;
}
console.log(JSON.parse(data));
console.log(JSON.parse(status));
}))
const stat = jsonData[stat];
var random = jsonData[stat][Math.floor(Math.random()*jsonContent[stat].length)];
const stati = await masto.statuses.create({
status: `${random} selfcare! 🌸`,
visibility: 'public',
});
console.log(stati.url);

2
clip Normal file
View file

@ -0,0 +1,2 @@
"type": "module",

10
dataset1.json Normal file
View file

@ -0,0 +1,10 @@
{
"status":[
"Yoga is",
"Baths are",
"Skin care routines are",
"New nail polish is",
"Meditation is",
"Smoking weed is"
]
}

44741
dotenv Normal file

File diff suppressed because it is too large Load diff

105929
express Normal file

File diff suppressed because it is too large Load diff

42533
masto Normal file

File diff suppressed because it is too large Load diff

1
node_modules/.bin/tsc generated vendored Symbolic link
View file

@ -0,0 +1 @@
../typescript/bin/tsc

1
node_modules/.bin/tsserver generated vendored Symbolic link
View file

@ -0,0 +1 @@
../typescript/bin/tsserver

33
node_modules/.package-lock.json generated vendored
View file

@ -725,6 +725,17 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/random": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/random/-/random-4.1.0.tgz",
"integrity": "sha512-6Ajb7XmMSE9EFAMGC3kg9mvE7fGlBip25mYYuSMzw/uUSrmGilvZo2qwX3RnTRjwXkwkS+4swse9otZ92VjAtQ==",
"dependencies": {
"seedrandom": "^3.0.5"
},
"engines": {
"node": ">=14"
}
},
"node_modules/range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
@ -747,6 +758,11 @@
"node": ">= 0.8"
}
},
"node_modules/rl": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/rl/-/rl-0.0.1.tgz",
"integrity": "sha512-7o+240rp1NZJa/AZeGXOued16m3iERog/Ivay4KLa6D5QGxFmoAEi2IdkH79mAqmvUo5hFILJm/l1kGOcqOTUQ=="
},
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
@ -771,6 +787,11 @@
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"node_modules/seedrandom": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz",
"integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg=="
},
"node_modules/semver": {
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
@ -902,6 +923,18 @@
"node": ">= 0.6"
}
},
"node_modules/typescript": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz",
"integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=12.20"
}
},
"node_modules/unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",

3
node_modules/random/dist/distributions/bates.d.ts generated vendored Normal file
View file

@ -0,0 +1,3 @@
import { Random } from '../random';
declare const _default: (random: Random, n?: number) => () => number;
export default _default;

View file

@ -0,0 +1,3 @@
import { Random } from '../random';
declare const _default: (random: Random, p?: number) => () => number;
export default _default;

3
node_modules/random/dist/distributions/binomial.d.ts generated vendored Normal file
View file

@ -0,0 +1,3 @@
import { Random } from '../random';
declare const _default: (random: Random, n?: number, p?: number) => () => number;
export default _default;

View file

@ -0,0 +1,3 @@
import { Random } from '../random';
declare const _default: (random: Random, lambda?: number) => () => number;
export default _default;

View file

@ -0,0 +1,3 @@
import { Random } from '../random';
declare const _default: (random: Random, p?: number) => () => number;
export default _default;

View file

@ -0,0 +1,3 @@
import { Random } from '../random';
declare const _default: (random: Random, n?: number) => () => number;
export default _default;

View file

@ -0,0 +1,3 @@
import { Random } from '../random';
declare const _default: (random: Random, mu?: number, sigma?: number) => () => number;
export default _default;

3
node_modules/random/dist/distributions/normal.d.ts generated vendored Normal file
View file

@ -0,0 +1,3 @@
import { Random } from '../random';
declare const _default: (random: Random, mu?: number, sigma?: number) => () => number;
export default _default;

3
node_modules/random/dist/distributions/pareto.d.ts generated vendored Normal file
View file

@ -0,0 +1,3 @@
import { Random } from '../random';
declare const _default: (random: Random, alpha?: number) => () => number;
export default _default;

3
node_modules/random/dist/distributions/poisson.d.ts generated vendored Normal file
View file

@ -0,0 +1,3 @@
import { Random } from '../random';
declare const _default: (random: Random, lambda?: number) => () => number;
export default _default;

View file

@ -0,0 +1,3 @@
import { Random } from '../random';
declare const _default: (random: Random) => () => boolean;
export default _default;

View file

@ -0,0 +1,3 @@
import { Random } from '../random';
declare const _default: (random: Random, min?: number, max?: number) => () => number;
export default _default;

3
node_modules/random/dist/distributions/uniform.d.ts generated vendored Normal file
View file

@ -0,0 +1,3 @@
import { Random } from '../random';
declare const _default: (random: Random, min?: number, max?: number) => () => number;
export default _default;

9
node_modules/random/dist/generators/function.d.ts generated vendored Normal file
View file

@ -0,0 +1,9 @@
import RNG, { SeedFn } from '../rng';
export default class RNGFunction extends RNG {
_rng: SeedFn;
constructor(thunk: SeedFn, opts?: Record<string, unknown>);
get name(): string;
next(): number;
seed(thunk: SeedFn, _opts?: Record<string, unknown>): void;
clone(_: undefined, opts: Record<string, unknown>): RNGFunction;
}

7
node_modules/random/dist/generators/math-random.d.ts generated vendored Normal file
View file

@ -0,0 +1,7 @@
import RNG from '../rng';
export default class RNGMathRandom extends RNG {
get name(): string;
next(): number;
seed(_seed: unknown, _opts: Record<string, unknown>): void;
clone(): RNGMathRandom;
}

12
node_modules/random/dist/generators/xor128.d.ts generated vendored Normal file
View file

@ -0,0 +1,12 @@
import RNG from '../rng';
export default class RNGXOR128 extends RNG {
x: number;
y: number;
z: number;
w: number;
constructor(seed: number, opts?: Record<string, unknown>);
get name(): string;
next(): number;
seed(seed: number, opts?: Record<string, unknown>): void;
clone(seed: number, opts: Record<string, unknown>): RNGXOR128;
}

3
node_modules/random/dist/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,3 @@
import random from './random';
export * from './random';
export default random;

267
node_modules/random/dist/random.d.ts generated vendored Normal file
View file

@ -0,0 +1,267 @@
import RNG from './rng';
import RNGFactory from './rng-factory';
/**
* Distribution function
*/
interface IDistFn<R> {
(random: Random, ...argv: any): R;
}
/**
* Distribution
*/
interface IDist<R> {
(): R;
}
/**
* Keyed cache entry
*/
interface ICacheEntry<T> {
key: string;
distribution: () => T;
}
export { RNG, RNGFactory };
/**
* Seedable random number generator supporting many common distributions.
*
* Defaults to Math.random as its underlying pseudorandom number generator.
*
* @name Random
* @class
*
* @param {RNG|function} [rng=Math.random] - Underlying pseudorandom number generator.
*/
export declare class Random {
protected _rng: RNG;
protected _patch: typeof Math.random | undefined;
protected _cache: {
[k: string]: ICacheEntry<any>;
};
constructor(rng?: RNG);
/**
* @member {RNG} Underlying pseudo-random number generator
*/
get rng(): RNG;
/**
* Creates a new `Random` instance, optionally specifying parameters to
* set a new seed.
*
* @see RNG.clone
*
* @param {string} [seed] - Optional seed for new RNG.
* @param {object} [opts] - Optional config for new RNG options.
* @return {Random}
*/
clone<T>(...args: [T]): Random;
/**
* Sets the underlying pseudorandom number generator used via
* either an instance of `seedrandom`, a custom instance of RNG
* (for PRNG plugins), or a string specifying the PRNG to use
* along with an optional `seed` and `opts` to initialize the
* RNG.
*
* @example
* import random from 'random'
*
* random.use('example_seedrandom_string')
* // or
* random.use(seedrandom('kittens'))
* // or
* random.use(Math.random)
*
* @param {...*} args
*/
use(...args: [RNG]): void;
/**
* Patches `Math.random` with this Random instance's PRNG.
*/
patch(): void;
/**
* Restores a previously patched `Math.random` to its original value.
*/
unpatch(): void;
/**
* Convenience wrapper around `this.rng.next()`
*
* Returns a floating point number in [0, 1).
*
* @return {number}
*/
next: () => number;
/**
* Samples a uniform random floating point number, optionally specifying
* lower and upper bounds.
*
* Convence wrapper around `random.uniform()`
*
* @param {number} [min=0] - Lower bound (float, inclusive)
* @param {number} [max=1] - Upper bound (float, exclusive)
* @return {number}
*/
float: (min?: number, max?: number) => number;
/**
* Samples a uniform random integer, optionally specifying lower and upper
* bounds.
*
* Convence wrapper around `random.uniformInt()`
*
* @param {number} [min=0] - Lower bound (integer, inclusive)
* @param {number} [max=1] - Upper bound (integer, inclusive)
* @return {number}
*/
int: (min?: number, max?: number) => number;
/**
* Samples a uniform random integer, optionally specifying lower and upper
* bounds.
*
* Convence wrapper around `random.uniformInt()`
*
* @alias `random.int`
*
* @param {number} [min=0] - Lower bound (integer, inclusive)
* @param {number} [max=1] - Upper bound (integer, inclusive)
* @return {number}
*/
integer: (min?: number, max?: number) => number;
/**
* Samples a uniform random boolean value.
*
* Convence wrapper around `random.uniformBoolean()`
*
* @alias `random.boolean`
*
* @return {boolean}
*/
bool: () => boolean;
/**
* Samples a uniform random boolean value.
*
* Convence wrapper around `random.uniformBoolean()`
*
* @return {boolean}
*/
boolean: () => boolean;
/**
* Returns an item chosen uniformly at trandom from the given array.
*
* Convence wrapper around `random.uniformInt()`
*
* @param {Array<T>} [array] - Lower bound (integer, inclusive)
* @return {T | undefined}
*/
choice<T>(array: Array<T>): T | undefined;
/**
* Generates a [Continuous uniform distribution](https://en.wikipedia.org/wiki/Uniform_distribution_(continuous)).
*
* @param {number} [min=0] - Lower bound (float, inclusive)
* @param {number} [max=1] - Upper bound (float, exclusive)
* @return {function}
*/
uniform: (min?: number, max?: number) => IDist<number>;
/**
* Generates a [Discrete uniform distribution](https://en.wikipedia.org/wiki/Discrete_uniform_distribution).
*
* @param {number} [min=0] - Lower bound (integer, inclusive)
* @param {number} [max=1] - Upper bound (integer, inclusive)
* @return {function}
*/
uniformInt: (min?: number, max?: number) => IDist<number>;
/**
* Generates a [Discrete uniform distribution](https://en.wikipedia.org/wiki/Discrete_uniform_distribution),
* with two possible outcomes, `true` or `false.
*
* This method is analogous to flipping a coin.
*
* @return {function}
*/
uniformBoolean: () => IDist<boolean>;
/**
* Generates a [Normal distribution](https://en.wikipedia.org/wiki/Normal_distribution).
*
* @param {number} [mu=0] - Mean
* @param {number} [sigma=1] - Standard deviation
* @return {function}
*/
normal: (mu?: number, sigma?: number) => () => number;
/**
* Generates a [Log-normal distribution](https://en.wikipedia.org/wiki/Log-normal_distribution).
*
* @param {number} [mu=0] - Mean of underlying normal distribution
* @param {number} [sigma=1] - Standard deviation of underlying normal distribution
* @return {function}
*/
logNormal: (mu?: number, sigma?: number) => () => number;
/**
* Generates a [Bernoulli distribution](https://en.wikipedia.org/wiki/Bernoulli_distribution).
*
* @param {number} [p=0.5] - Success probability of each trial.
* @return {function}
*/
bernoulli: (p?: number) => () => number;
/**
* Generates a [Binomial distribution](https://en.wikipedia.org/wiki/Binomial_distribution).
*
* @param {number} [n=1] - Number of trials.
* @param {number} [p=0.5] - Success probability of each trial.
* @return {function}
*/
binomial: (n?: number, p?: number) => () => number;
/**
* Generates a [Geometric distribution](https://en.wikipedia.org/wiki/Geometric_distribution).
*
* @param {number} [p=0.5] - Success probability of each trial.
* @return {function}
*/
geometric: (p?: number) => () => number;
/**
* Generates a [Poisson distribution](https://en.wikipedia.org/wiki/Poisson_distribution).
*
* @param {number} [lambda=1] - Mean (lambda > 0)
* @return {function}
*/
poisson: (lambda?: number) => () => number;
/**
* Generates an [Exponential distribution](https://en.wikipedia.org/wiki/Exponential_distribution).
*
* @param {number} [lambda=1] - Inverse mean (lambda > 0)
* @return {function}
*/
exponential: (lambda?: number) => () => number;
/**
* Generates an [Irwin Hall distribution](https://en.wikipedia.org/wiki/Irwin%E2%80%93Hall_distribution).
*
* @param {number} [n=1] - Number of uniform samples to sum (n >= 0)
* @return {function}
*/
irwinHall: (n?: number) => () => number;
/**
* Generates a [Bates distribution](https://en.wikipedia.org/wiki/Bates_distribution).
*
* @param {number} [n=1] - Number of uniform samples to average (n >= 1)
* @return {function}
*/
bates: (n?: number) => () => number;
/**
* Generates a [Pareto distribution](https://en.wikipedia.org/wiki/Pareto_distribution).
*
* @param {number} [alpha=1] - Alpha
* @return {function}
*/
pareto: (alpha?: number) => () => number;
/**
* Memoizes distributions to ensure they're only created when necessary.
*
* Returns a thunk which that returns independent, identically distributed
* samples from the specified distribution.
*
* @private
*
* @param {string} label - Name of distribution
* @param {function} getter - Function which generates a new distribution
* @param {...*} args - Distribution-specific arguments
*
* @return {function}
*/
_memoize<T>(label: string, getter: IDistFn<any>, ...args: any[]): IDist<T>;
}
declare const _default: Random;
export default _default;

638
node_modules/random/dist/random.module.js generated vendored Normal file
View file

@ -0,0 +1,638 @@
import seedrandom from 'seedrandom';
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf(subClass, superClass);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
}
var RNG = /*#__PURE__*/function () {
function RNG() {}
var _proto = RNG.prototype;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_proto._seed = function _seed(seed, _opts) {
// TODO: add entropy and stuff
if (seed === (seed || 0)) {
return seed;
} else {
var strSeed = '' + seed;
var s = 0;
for (var k = 0; k < strSeed.length; ++k) {
s ^= strSeed.charCodeAt(k) | 0;
}
return s;
}
};
return RNG;
}();
var RNGFunction = /*#__PURE__*/function (_RNG) {
_inheritsLoose(RNGFunction, _RNG);
function RNGFunction(thunk, opts) {
var _this;
_this = _RNG.call(this) || this;
_this._rng = void 0;
_this.seed(thunk, opts);
return _this;
}
var _proto = RNGFunction.prototype;
_proto.next = function next() {
return this._rng();
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
;
_proto.seed = function seed(thunk, _opts) {
this._rng = thunk;
};
_proto.clone = function clone(_, opts) {
return new RNGFunction(this._rng, opts);
};
_createClass(RNGFunction, [{
key: "name",
get: function get() {
return 'function';
}
}]);
return RNGFunction;
}(RNG);
/**
* Construct an RNG with variable inputs. Used in calls to Random constructor
* @param {...*} args - Distribution-specific arguments
* @return RNG
*
* @example
* new Random(RNGFactory(...args))
*/
var RNGFactory = (function () {
var args = [].slice.call(arguments);
var _args = args,
_args$ = _args[0],
arg0 = _args$ === void 0 ? 'default' : _args$;
switch (typeof arg0) {
case 'object':
if (arg0 instanceof RNG) {
return arg0;
}
break;
case 'function':
return new RNGFunction(arg0);
case 'number':
case 'string':
default:
return new RNGFunction(seedrandom.apply(void 0, args));
}
throw new Error("invalid RNG \"" + arg0 + "\"");
});
var uniform = (function (random, min, max) {
if (min === void 0) {
min = 0;
}
if (max === void 0) {
max = 1;
}
return function () {
return random.next() * (max - min) + min;
};
});
function numberValidator(num) {
return new NumberValidator(num);
}
var NumberValidator = function NumberValidator(num) {
var _this = this;
this.n = void 0;
this.isInt = function () {
if (Number.isInteger(_this.n)) {
return _this;
}
throw new Error("Expected number to be an integer, got " + _this.n);
};
this.isPositive = function () {
if (_this.n > 0) {
return _this;
}
throw new Error("Expected number to be positive, got " + _this.n);
};
this.lessThan = function (v) {
if (_this.n < v) {
return _this;
}
throw new Error("Expected number to be less than " + v + ", got " + _this.n);
};
this.greaterThanOrEqual = function (v) {
if (_this.n >= v) {
return _this;
}
throw new Error("Expected number to be greater than or equal to " + v + ", got " + _this.n);
};
this.greaterThan = function (v) {
if (_this.n > v) {
return _this;
}
throw new Error("Expected number to be greater than " + v + ", got " + _this.n);
};
this.n = num;
};
var uniformInt = (function (random, min, max) {
if (min === void 0) {
min = 0;
}
if (max === void 0) {
max = 1;
}
if (max === undefined) {
max = min === undefined ? 1 : min;
min = 0;
}
numberValidator(min).isInt();
numberValidator(max).isInt();
return function () {
return Math.floor(random.next() * (max - min + 1) + min);
};
});
var uniformBoolean = (function (random) {
return function () {
return random.next() >= 0.5;
};
});
var normal = (function (random, mu, sigma) {
if (mu === void 0) {
mu = 0;
}
if (sigma === void 0) {
sigma = 1;
}
return function () {
var x, y, r;
do {
x = random.next() * 2 - 1;
y = random.next() * 2 - 1;
r = x * x + y * y;
} while (!r || r > 1);
return mu + sigma * y * Math.sqrt(-2 * Math.log(r) / r);
};
});
var logNormal = (function (random, mu, sigma) {
if (mu === void 0) {
mu = 0;
}
if (sigma === void 0) {
sigma = 1;
}
var normal = random.normal(mu, sigma);
return function () {
return Math.exp(normal());
};
});
var bernoulli = (function (random, p) {
if (p === void 0) {
p = 0.5;
}
numberValidator(p).greaterThanOrEqual(0).lessThan(1);
return function () {
return Math.floor(random.next() + p);
};
});
var binomial = (function (random, n, p) {
if (n === void 0) {
n = 1;
}
if (p === void 0) {
p = 0.5;
}
numberValidator(n).isInt().isPositive();
numberValidator(p).greaterThanOrEqual(0).lessThan(1);
return function () {
var i = 0;
var x = 0;
while (i++ < n) {
if (random.next() < p) {
x++;
}
}
return x;
};
});
var geometric = (function (random, p) {
if (p === void 0) {
p = 0.5;
}
numberValidator(p).greaterThan(0).lessThan(1);
var invLogP = 1.0 / Math.log(1.0 - p);
return function () {
return Math.floor(1 + Math.log(random.next()) * invLogP);
};
});
var logFactorialTable = [0.0, 0.0, 0.69314718055994529, 1.791759469228055, 3.1780538303479458, 4.7874917427820458, 6.5792512120101012, 8.5251613610654147, 10.604602902745251, 12.801827480081469];
var logFactorial = function logFactorial(k) {
return logFactorialTable[k];
};
var logSqrt2PI = 0.91893853320467267;
var poisson = (function (random, lambda) {
if (lambda === void 0) {
lambda = 1;
}
numberValidator(lambda).isPositive();
if (lambda < 10) {
// inversion method
var expMean = Math.exp(-lambda);
return function () {
var p = expMean;
var x = 0;
var u = random.next();
while (u > p) {
u = u - p;
p = lambda * p / ++x;
}
return x;
};
} else {
// generative method
var smu = Math.sqrt(lambda);
var b = 0.931 + 2.53 * smu;
var a = -0.059 + 0.02483 * b;
var invAlpha = 1.1239 + 1.1328 / (b - 3.4);
var vR = 0.9277 - 3.6224 / (b - 2);
return function () {
while (true) {
var u = void 0;
var v = random.next();
if (v <= 0.86 * vR) {
u = v / vR - 0.43;
return Math.floor((2 * a / (0.5 - Math.abs(u)) + b) * u + lambda + 0.445);
}
if (v >= vR) {
u = random.next() - 0.5;
} else {
u = v / vR - 0.93;
u = (u < 0 ? -0.5 : 0.5) - u;
v = random.next() * vR;
}
var us = 0.5 - Math.abs(u);
if (us < 0.013 && v > us) {
continue;
}
var k = Math.floor((2 * a / us + b) * u + lambda + 0.445);
v = v * invAlpha / (a / (us * us) + b);
if (k >= 10) {
var t = (k + 0.5) * Math.log(lambda / k) - lambda - logSqrt2PI + k - (1 / 12.0 - (1 / 360.0 - 1 / (1260.0 * k * k)) / (k * k)) / k;
if (Math.log(v * smu) <= t) {
return k;
}
} else if (k >= 0) {
var _logFactorial;
var f = (_logFactorial = logFactorial(k)) != null ? _logFactorial : 0;
if (Math.log(v) <= k * Math.log(lambda) - lambda - f) {
return k;
}
}
}
};
}
});
var exponential = (function (random, lambda) {
if (lambda === void 0) {
lambda = 1;
}
numberValidator(lambda).isPositive();
return function () {
return -Math.log(1 - random.next()) / lambda;
};
});
var irwinHall = (function (random, n) {
if (n === void 0) {
n = 1;
}
numberValidator(n).isInt().greaterThanOrEqual(0);
return function () {
var sum = 0;
for (var i = 0; i < n; ++i) {
sum += random.next();
}
return sum;
};
});
var bates = (function (random, n) {
if (n === void 0) {
n = 1;
}
numberValidator(n).isInt().isPositive();
var irwinHall = random.irwinHall(n);
return function () {
return irwinHall() / n;
};
});
var pareto = (function (random, alpha) {
if (alpha === void 0) {
alpha = 1;
}
numberValidator(alpha).greaterThanOrEqual(0);
var invAlpha = 1.0 / alpha;
return function () {
return 1.0 / Math.pow(1.0 - random.next(), invAlpha);
};
});
var RNGMathRandom = /*#__PURE__*/function (_RNG) {
_inheritsLoose(RNGMathRandom, _RNG);
function RNGMathRandom() {
return _RNG.apply(this, arguments) || this;
}
var _proto = RNGMathRandom.prototype;
_proto.next = function next() {
return Math.random();
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
;
_proto.seed = function seed(_seed, _opts) {
// intentionally empty
};
_proto.clone = function clone() {
return new RNGMathRandom();
};
_createClass(RNGMathRandom, [{
key: "name",
get: function get() {
return 'default';
}
}]);
return RNGMathRandom;
}(RNG);
/**
* Seedable random number generator supporting many common distributions.
*
* Defaults to Math.random as its underlying pseudorandom number generator.
*
* @name Random
* @class
*
* @param {RNG|function} [rng=Math.random] - Underlying pseudorandom number generator.
*/
var Random = /*#__PURE__*/function () {
function Random(rng) {
var _this = this;
this._rng = void 0;
this._patch = void 0;
this._cache = {};
this.next = function () {
return _this._rng.next();
};
this["float"] = function (min, max) {
return _this.uniform(min, max)();
};
this["int"] = function (min, max) {
return _this.uniformInt(min, max)();
};
this.integer = function (min, max) {
return _this.uniformInt(min, max)();
};
this.bool = function () {
return _this.uniformBoolean()();
};
this["boolean"] = function () {
return _this.uniformBoolean()();
};
this.uniform = function (min, max) {
return _this._memoize('uniform', uniform, min, max);
};
this.uniformInt = function (min, max) {
return _this._memoize('uniformInt', uniformInt, min, max);
};
this.uniformBoolean = function () {
return _this._memoize('uniformBoolean', uniformBoolean);
};
this.normal = function (mu, sigma) {
return normal(_this, mu, sigma);
};
this.logNormal = function (mu, sigma) {
return logNormal(_this, mu, sigma);
};
this.bernoulli = function (p) {
return bernoulli(_this, p);
};
this.binomial = function (n, p) {
return binomial(_this, n, p);
};
this.geometric = function (p) {
return geometric(_this, p);
};
this.poisson = function (lambda) {
return poisson(_this, lambda);
};
this.exponential = function (lambda) {
return exponential(_this, lambda);
};
this.irwinHall = function (n) {
return irwinHall(_this, n);
};
this.bates = function (n) {
return bates(_this, n);
};
this.pareto = function (alpha) {
return pareto(_this, alpha);
};
if (rng && rng instanceof RNG) {
this.use(rng);
} else {
this.use(new RNGMathRandom());
}
this._cache = {};
}
/**
* @member {RNG} Underlying pseudo-random number generator
*/
var _proto = Random.prototype;
/**
* Creates a new `Random` instance, optionally specifying parameters to
* set a new seed.
*
* @see RNG.clone
*
* @param {string} [seed] - Optional seed for new RNG.
* @param {object} [opts] - Optional config for new RNG options.
* @return {Random}
*/
_proto.clone = function clone() {
var args = [].slice.call(arguments);
if (args.length) {
return new Random(RNGFactory.apply(void 0, args));
} else {
return new Random(this.rng.clone());
}
}
/**
* Sets the underlying pseudorandom number generator used via
* either an instance of `seedrandom`, a custom instance of RNG
* (for PRNG plugins), or a string specifying the PRNG to use
* along with an optional `seed` and `opts` to initialize the
* RNG.
*
* @example
* import random from 'random'
*
* random.use('example_seedrandom_string')
* // or
* random.use(seedrandom('kittens'))
* // or
* random.use(Math.random)
*
* @param {...*} args
*/;
_proto.use = function use() {
this._rng = RNGFactory.apply(void 0, [].slice.call(arguments));
}
/**
* Patches `Math.random` with this Random instance's PRNG.
*/;
_proto.patch = function patch() {
if (this._patch) {
throw new Error('Math.random already patched');
}
this._patch = Math.random;
Math.random = this.uniform();
}
/**
* Restores a previously patched `Math.random` to its original value.
*/;
_proto.unpatch = function unpatch() {
if (this._patch) {
Math.random = this._patch;
delete this._patch;
}
}
// --------------------------------------------------------------------------
// Uniform utility functions
// --------------------------------------------------------------------------
/**
* Convenience wrapper around `this.rng.next()`
*
* Returns a floating point number in [0, 1).
*
* @return {number}
*/;
/**
* Returns an item chosen uniformly at trandom from the given array.
*
* Convence wrapper around `random.uniformInt()`
*
* @param {Array<T>} [array] - Lower bound (integer, inclusive)
* @return {T | undefined}
*/
_proto.choice = function choice(array) {
if (!Array.isArray(array)) {
throw new Error("Random.choice expected input to be an array, got " + typeof array);
}
var length = array == null ? void 0 : array.length;
if (length > 0) {
var index = this.uniformInt(0, length - 1)();
return array[index];
} else {
return undefined;
}
}
// --------------------------------------------------------------------------
// Uniform distributions
// --------------------------------------------------------------------------
/**
* Generates a [Continuous uniform distribution](https://en.wikipedia.org/wiki/Uniform_distribution_(continuous)).
*
* @param {number} [min=0] - Lower bound (float, inclusive)
* @param {number} [max=1] - Upper bound (float, exclusive)
* @return {function}
*/;
// --------------------------------------------------------------------------
// Internal
// --------------------------------------------------------------------------
/**
* Memoizes distributions to ensure they're only created when necessary.
*
* Returns a thunk which that returns independent, identically distributed
* samples from the specified distribution.
*
* @private
*
* @param {string} label - Name of distribution
* @param {function} getter - Function which generates a new distribution
* @param {...*} args - Distribution-specific arguments
*
* @return {function}
*/
_proto._memoize = function _memoize(label, getter) {
var args = [].slice.call(arguments, 2);
var key = "" + args.join(';');
var value = this._cache[label];
if (value === undefined || value.key !== key) {
value = {
key: key,
distribution: getter.apply(void 0, [this].concat(args))
};
this._cache[label] = value;
}
return value.distribution;
};
_createClass(Random, [{
key: "rng",
get: function get() {
return this._rng;
}
}]);
return Random;
}();
// defaults to Math.random as its RNG
var random = new Random();
export { RNG, RNGFactory, Random, random as default };
//# sourceMappingURL=random.module.js.map

1
node_modules/random/dist/random.module.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

11
node_modules/random/dist/rng-factory.d.ts generated vendored Normal file
View file

@ -0,0 +1,11 @@
import RNG from './rng';
/**
* Construct an RNG with variable inputs. Used in calls to Random constructor
* @param {...*} args - Distribution-specific arguments
* @return RNG
*
* @example
* new Random(RNGFactory(...args))
*/
declare const _default: <T extends any[]>(...args: T) => RNG;
export default _default;

9
node_modules/random/dist/rng.d.ts generated vendored Normal file
View file

@ -0,0 +1,9 @@
export type SeedFn = () => number;
export type SeedType = number | string | SeedFn | RNG;
export default abstract class RNG {
abstract get name(): string;
abstract next(): number;
abstract seed(_seed?: SeedType, _opts?: Record<string, unknown>): void;
abstract clone(_seed?: SeedType, _opts?: Record<string, unknown>): RNG;
_seed(seed: number, _opts?: Record<string, unknown>): number;
}

10
node_modules/random/dist/validation.d.ts generated vendored Normal file
View file

@ -0,0 +1,10 @@
export declare function numberValidator(num: number): NumberValidator;
export declare class NumberValidator {
private n;
constructor(num: number);
isInt: () => this;
isPositive: () => this;
lessThan: (v: number) => this;
greaterThanOrEqual: (v: number) => this;
greaterThan: (v: number) => this;
}

21
node_modules/random/license generated vendored Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Travis Fischer
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.

89
node_modules/random/package.json generated vendored Normal file
View file

@ -0,0 +1,89 @@
{
"name": "random",
"version": "4.1.0",
"description": "Seedable random number generator supporting many common distributions.",
"repository": "transitive-bullshit/random",
"author": "Travis Fischer <travis@transitivebullsh.it>",
"type": "module",
"exports": {
"import": "./dist/random.module.js",
"types": "./dist/index.d.ts",
"default": "./dist/random.module.js"
},
"files": [
"dist"
],
"source": "./src/index.ts",
"module": "./dist/random.module.js",
"types": "./dist/index.d.ts",
"sideEffects": false,
"license": "MIT",
"engines": {
"node": ">=14"
},
"scripts": {
"start": "run-s build:watch",
"build": "microbundle -f esm --no-compress",
"build:watch": "microbundle -f esm --no-compress --watch",
"prebuild": "run-s clean",
"prebuild:watch": "run-s clean",
"clean": "del dist",
"prepublishOnly": "run-s build",
"docs": "update-markdown-jsdoc -f dist/random.module.js --shallow",
"pretest": "run-s build",
"test": "run-s test:*",
"test:unit": "ava -v",
"test:prettier": "prettier '**/*.{js,jsx,ts,tsx}' --check",
"test:lint": "eslint ."
},
"keywords": [
"random",
"number",
"generator",
"rng",
"prng",
"stats",
"d3-random",
"seedrandom",
"distribution",
"pseudorandom",
"uniform",
"normal",
"gaussian",
"lognormal",
"poisson",
"exponential",
"irwinhall",
"bates"
],
"dependencies": {
"seedrandom": "^3.0.5"
},
"devDependencies": {
"@ava/typescript": "^3.0.1",
"@esbuild-kit/esm-loader": "^2.5.0",
"@types/node": "^18.11.9",
"@types/seedrandom": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"ava": "^5.0.1",
"del-cli": "^5.0.0",
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"microbundle": "^0.15.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"typescript": "^4.8.4",
"update-markdown-jsdoc": "^1.0.11"
},
"ava": {
"extensions": {
"ts": "module"
},
"nodeArguments": [
"--loader=@esbuild-kit/esm-loader"
]
}
}

523
node_modules/random/readme.md generated vendored Normal file
View file

@ -0,0 +1,523 @@
# random <!-- omit in toc -->
> Seedable random number generator supporting many common distributions.
[![NPM](https://img.shields.io/npm/v/random.svg)](https://www.npmjs.com/package/random) [![Build Status](https://github.com/transitive-bullshit/random/actions/workflows/test.yml/badge.svg)](https://github.com/transitive-bullshit/random/actions/workflows/test.yml) [![Prettier Code Formatting](https://img.shields.io/badge/code_style-prettier-brightgreen.svg)](https://prettier.io)
Welcome to the most **random** module on npm! 😜
## Highlights <!-- omit in toc -->
- Simple API (_make easy things easy and hard things possible_)
- TypeScript supported!
- Seedable based on entropy or user input
- Plugin support for different pseudo random number generators (PRNGs)
- Sample from many common distributions
- uniform, normal, poisson, bernoulli, etc
- Validates all user input via [ow](https://github.com/sindresorhus/ow)
- Integrates with [seedrandom](https://github.com/davidbau/seedrandom)
- Supports node >= 14 and browser
## Install <!-- omit in toc -->
```bash
npm install --save random
# or
yarn add random
# or
pnpm add random
```
Note: this package uses ESM and no longer provides a CommonJS export. See [here](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) for more info on how to use ESM modules.
## Usage <!-- omit in toc -->
```ts
import random from 'random'
// quick uniform shortcuts
random.float((min = 0), (max = 1)) // uniform float in [ min, max )
random.int((min = 0), (max = 1)) // uniform integer in [ min, max ]
random.boolean() // true or false
// uniform distribution
random.uniform((min = 0), (max = 1)) // () => [ min, max )
random.uniformInt((min = 0), (max = 1)) // () => [ min, max ]
random.uniformBoolean() // () => [ false, true ]
// normal distribution
random.normal((mu = 0), (sigma = 1))
random.logNormal((mu = 0), (sigma = 1))
// bernoulli distribution
random.bernoulli((p = 0.5))
random.binomial((n = 1), (p = 0.5))
random.geometric((p = 0.5))
// poisson distribution
random.poisson((lambda = 1))
random.exponential((lambda = 1))
// misc distribution
random.irwinHall(n)
random.bates(n)
random.pareto(alpha)
```
For convenience, several common uniform samplers are exposed directly:
```ts
random.float() // 0.2149383367670885
random.int(0, 100) // 72
random.boolean() // true
// random array item
random.choice([1, true, 'foo']) // 'foo'
```
**All distribution methods return a thunk** (function with no params), which will return a series of independent, identically distributed random variables from the specified distribution.
```ts
// create a normal distribution with default params (mu=1 and sigma=0)
const normal = random.normal()
normal() // 0.4855465422678824
normal() // -0.06696771815439678
normal() // 0.7350852689834705
// create a poisson distribution with default params (lambda=1)
const poisson = random.poisson()
poisson() // 0
poisson() // 4
poisson() // 1
```
Note that returning a thunk here is more efficient when generating multiple
samples from the same distribution.
You can change the underlying PRNG or its seed as follows:
```ts
import seedrandom from 'seedrandom'
// change the underlying pseudo random number generator
// by default, Math.random is used as the underlying PRNG
random.use(seedrandom('foobar'))
// create a new independent random number generator (uses seedrandom under the hood)
const rng = random.clone('my-new-seed')
// create a second independent random number generator and use a seeded PRNG
const rng2 = random.clone(seedrandom('kittyfoo'))
// replace Math.random with rng.uniform
rng.patch()
// restore original Math.random
rng.unpatch()
```
You can also instantiate a fresh instance of `Random`:
```ts
import { Random } from 'random'
import seedrandom from 'seedrandom'
const rng = new Random()
const rng2 = new Random(seedrandom('tinykittens'))
```
## API <!-- omit in toc -->
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
#### Table of Contents <!-- omit in toc -->
<!-- no toc -->
- [Random](#random)
- [rng](#rng)
- [clone](#clone)
- [use](#use)
- [patch](#patch)
- [unpatch](#unpatch)
- [next](#next)
- [float](#float)
- [int](#int)
- [integer](#integer)
- [bool](#bool)
- [boolean](#boolean)
- [choice](#choice)
- [uniform](#uniform)
- [uniformInt](#uniformint)
- [uniformBoolean](#uniformboolean)
- [normal](#normal)
- [logNormal](#lognormal)
- [bernoulli](#bernoulli)
- [binomial](#binomial)
- [geometric](#geometric)
- [poisson](#poisson)
- [exponential](#exponential)
- [irwinHall](#irwinhall)
- [bates](#bates)
- [pareto](#pareto)
### [Random](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L36-L382)
Seedable random number generator supporting many common distributions.
Defaults to Math.random as its underlying pseudorandom number generator.
Type: `function (rng)`
- `rng` **(RNG | [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function))** Underlying pseudorandom number generator. (optional, default `Math.random`)
---
#### [rng](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L47-L49)
Type: `function ()`
---
#### [clone](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L61-L67)
- **See: RNG.clone**
Creates a new `Random` instance, optionally specifying parameters to
set a new seed.
Type: `function (args, seed, opts): Random`
- `args` **...any**
- `seed` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Optional seed for new RNG.
- `opts` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Optional config for new RNG options.
---
#### [use](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L87-L89)
Sets the underlying pseudorandom number generator used via
either an instance of `seedrandom`, a custom instance of RNG
(for PRNG plugins), or a string specifying the PRNG to use
along with an optional `seed` and `opts` to initialize the
RNG.
Type: `function (args)`
- `args` **...any**
Example:
```javascript
import random from 'random'
random.use('example_seedrandom_string')
// or
random.use(seedrandom('kittens'))
// or
random.use(Math.random)
```
---
#### [patch](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L94-L101)
Patches `Math.random` with this Random instance's PRNG.
Type: `function ()`
---
#### [unpatch](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L106-L111)
Restores a previously patched `Math.random` to its original value.
Type: `function ()`
---
#### [next](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L124-L126)
Convenience wrapper around `this.rng.next()`
Returns a floating point number in \[0, 1).
Type: `function (): number`
---
#### [float](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L138-L140)
Samples a uniform random floating point number, optionally specifying
lower and upper bounds.
Convence wrapper around `random.uniform()`
Type: `function (min, max): number`
- `min` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Lower bound (float, inclusive) (optional, default `0`)
- `max` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Upper bound (float, exclusive) (optional, default `1`)
---
#### [int](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L152-L154)
Samples a uniform random integer, optionally specifying lower and upper
bounds.
Convence wrapper around `random.uniformInt()`
Type: `function (min, max): number`
- `min` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Lower bound (integer, inclusive) (optional, default `0`)
- `max` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Upper bound (integer, inclusive) (optional, default `1`)
---
#### [integer](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L168-L170)
Samples a uniform random integer, optionally specifying lower and upper
bounds.
Convence wrapper around `random.uniformInt()`
Type: `function (min, max): number`
- `min` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Lower bound (integer, inclusive) (optional, default `0`)
- `max` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Upper bound (integer, inclusive) (optional, default `1`)
---
#### [bool](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L181-L183)
Samples a uniform random boolean value.
Convence wrapper around `random.uniformBoolean()`
Type: `function (): boolean`
---
#### [boolean](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L192-L194)
Samples a uniform random boolean value.
Convence wrapper around `random.uniformBoolean()`
Type: `function (): boolean`
---
#### [choice]()
Returns an item chosen uniformly at trandom from the given array.
Convence wrapper around `random.uniformInt()`
Type: `function choice <T> (array: Array<T>): T | undefined`
- `array` **[Array<T>](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** Array of items to sample from
---
#### [uniform](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L207-L209)
Generates a [Continuous uniform distribution](<https://en.wikipedia.org/wiki/Uniform_distribution_(continuous)>).
Type: `function (min, max): function`
- `min` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Lower bound (float, inclusive) (optional, default `0`)
- `max` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Upper bound (float, exclusive) (optional, default `1`)
---
#### [uniformInt](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L218-L220)
Generates a [Discrete uniform distribution](https://en.wikipedia.org/wiki/Discrete_uniform_distribution).
Type: `function (min, max): function`
- `min` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Lower bound (integer, inclusive) (optional, default `0`)
- `max` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Upper bound (integer, inclusive) (optional, default `1`)
---
#### [uniformBoolean](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L230-L232)
Generates a [Discrete uniform distribution](https://en.wikipedia.org/wiki/Discrete_uniform_distribution),
with two possible outcomes, `true` or \`false.
This method is analogous to flipping a coin.
Type: `function (): function`
---
#### [normal](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L245-L247)
Generates a [Normal distribution](https://en.wikipedia.org/wiki/Normal_distribution).
Type: `function (mu, sigma): function`
- `mu` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Mean (optional, default `0`)
- `sigma` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Standard deviation (optional, default `1`)
---
#### [logNormal](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L256-L258)
Generates a [Log-normal distribution](https://en.wikipedia.org/wiki/Log-normal_distribution).
Type: `function (mu, sigma): function`
- `mu` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Mean of underlying normal distribution (optional, default `0`)
- `sigma` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Standard deviation of underlying normal distribution (optional, default `1`)
---
#### [bernoulli](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L270-L272)
Generates a [Bernoulli distribution](https://en.wikipedia.org/wiki/Bernoulli_distribution).
Type: `function (p): function`
- `p` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Success probability of each trial. (optional, default `0.5`)
---
#### [binomial](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L281-L283)
Generates a [Binomial distribution](https://en.wikipedia.org/wiki/Binomial_distribution).
Type: `function (n, p): function`
- `n` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of trials. (optional, default `1`)
- `p` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Success probability of each trial. (optional, default `0.5`)
---
#### [geometric](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L291-L293)
Generates a [Geometric distribution](https://en.wikipedia.org/wiki/Geometric_distribution).
Type: `function (p): function`
- `p` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Success probability of each trial. (optional, default `0.5`)
---
#### [poisson](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L305-L307)
Generates a [Poisson distribution](https://en.wikipedia.org/wiki/Poisson_distribution).
Type: `function (lambda): function`
- `lambda` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Mean (lambda > 0) (optional, default `1`)
---
#### [exponential](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L315-L317)
Generates an [Exponential distribution](https://en.wikipedia.org/wiki/Exponential_distribution).
Type: `function (lambda): function`
- `lambda` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Inverse mean (lambda > 0) (optional, default `1`)
---
#### [irwinHall](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L329-L331)
Generates an [Irwin Hall distribution](https://en.wikipedia.org/wiki/Irwin%E2%80%93Hall_distribution).
Type: `function (n): function`
- `n` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of uniform samples to sum (n >= 0) (optional, default `1`)
---
#### [bates](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L339-L341)
Generates a [Bates distribution](https://en.wikipedia.org/wiki/Bates_distribution).
Type: `function (n): function`
- `n` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of uniform samples to average (n >= 1) (optional, default `1`)
---
#### [pareto](https://github.com/transitive-bullshit/random/blob/e11a840a1cfe0f5bd9c43640f9645a0b28f61406/src/random.js#L349-L351)
Generates a [Pareto distribution](https://en.wikipedia.org/wiki/Pareto_distribution).
Type: `function (alpha): function`
- `alpha` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Alpha (optional, default `1`)
---
## Todo <!-- omit in toc -->
- Distributions
- [x] uniform
- [x] uniformInt
- [x] uniformBoolean
- [x] normal
- [x] logNormal
- [ ] chiSquared
- [ ] cauchy
- [ ] fischerF
- [ ] studentT
- [x] bernoulli
- [x] binomial
- [ ] negativeBinomial
- [x] geometric
- [x] poisson
- [x] exponential
- [ ] gamma
- [ ] hyperExponential
- [ ] weibull
- [ ] beta
- [ ] laplace
- [x] irwinHall
- [x] bates
- [x] pareto
- Generators
- [x] pluggable prng
- [ ] port more prng from boost
- [ ] custom entropy
- Misc
- [x] browser support via rollup
- [x] basic docs
- [x] basic tests
- [x] test suite
- [x] initial release!
- [x] typescript support
## Related <!-- omit in toc -->
- [d3-random](https://github.com/d3/d3-random) - D3's excellent random number generation library.
- [seedrandom](https://github.com/davidbau/seedrandom) - Seedable pseudo random number generator.
- [random-int](https://github.com/sindresorhus/random-int) - For the common use case of generating uniform random ints.
- [random-float](https://github.com/sindresorhus/random-float) - For the common use case of generating uniform random floats.
- [randombytes](https://github.com/crypto-browserify/randombytes) - Random crypto bytes for Node.js and the browser.
## Credit <!-- omit in toc -->
Thanks go to [Andrew Moss](https://github.com/agmoss) for the TypeScript port and for helping to maintain this package!
Shoutout to [Roger Combs](https://github.com/rcombs) for donating the `random` npm package for this project!
Lots of inspiration from [d3-random](https://github.com/d3/d3-random) ([@mbostock](https://github.com/mbostock) and [@svanschooten](https://github.com/svanschooten)).
Some distributions and PRNGs are ported from C++ [boost::random](https://www.boost.org/doc/libs/1_66_0/doc/html/boost_random/reference.html#boost_random.reference.distributions).
## License <!-- omit in toc -->
MIT © [Travis Fischer](https://transitivebullsh.it)
Support my OSS work by <a href="https://twitter.com/transitive_bs">following me on twitter <img src="https://storage.googleapis.com/saasify-assets/twitter-logo.svg" alt="twitter" height="24px" align="center"></a>

2
node_modules/rl/README.md generated vendored Normal file
View file

@ -0,0 +1,2 @@
rl
==

37
node_modules/rl/index.js generated vendored Normal file
View file

@ -0,0 +1,37 @@
var util = require('util');
var stream = require('stream');
var Transform = stream.Transform;
module.exports = StreamOfLines;
function StreamOfLines(options) {
Transform.call(this, options);
this._prevChunks = [];
this._hasPrevChunks = false;
}
util.inherits(StreamOfLines, Transform);
StreamOfLines.prototype._transform = function(chunk, encoding, callback) {
chunk = chunk.toString();
var fromIndex = 0;
var newLineIndex;
while ((newLineIndex = chunk.indexOf('\n', fromIndex)) != -1) {
var line;
if (this._hasPrevChunks) {
line = this._prevChunks.join('') + chunk.substring(fromIndex, newLineIndex);
this._prevChunks = [];
this._hasPrevChunks = false;
} else {
line = chunk.substring(fromIndex, newLineIndex);
}
fromIndex = newLineIndex + 1;
this.push(line);
}
if (fromIndex < chunk.length) {
this._prevChunks.push(chunk.substring(fromIndex));
this._hasPrevChunks = true;
}
callback();
}

15
node_modules/rl/package.json generated vendored Normal file
View file

@ -0,0 +1,15 @@
{
"name": "rl",
"version": "0.0.1",
"description": "Read line by line from a stream",
"main": "index.js",
"repository": {
"type": "git",
"url": "git@github.com:grudzinski/rl.git"
},
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/grudzinski/rl/issues"
}
}

1
node_modules/seedrandom/.coveralls.yml generated vendored Normal file
View file

@ -0,0 +1 @@
service_name: travis-ci

1
node_modules/seedrandom/.nvmrc generated vendored Normal file
View file

@ -0,0 +1 @@
6

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"uuid":"f02e18a9-b1c7-4946-836e-c3dbfb9635a3","parent":null,"pid":8128,"argv":["/home/davidbau/.nvm/versions/node/v11.9.0/bin/node","/home/davidbau/git/seedrandom/node_modules/mocha/bin/_mocha","test/cryptotest.js","test/nodetest.js","test/prngtest.js"],"execArgv":[],"cwd":"/home/davidbau/git/seedrandom","time":1568716532937,"ppid":8121,"root":"23c2e786-6463-4b5a-9042-75ea3257640f","coverageFilename":"/home/davidbau/git/seedrandom/.nyc_output/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json","files":["/home/davidbau/git/seedrandom/seedrandom.js","/home/davidbau/git/seedrandom/lib/xor128.js","/home/davidbau/git/seedrandom/lib/xorwow.js","/home/davidbau/git/seedrandom/lib/xorshift7.js","/home/davidbau/git/seedrandom/lib/xor4096.js","/home/davidbau/git/seedrandom/lib/tychei.js","/home/davidbau/git/seedrandom/lib/alea.js"]}

View file

@ -0,0 +1 @@
{"processes":{"f02e18a9-b1c7-4946-836e-c3dbfb9635a3":{"parent":null,"children":[]}},"files":{"/home/davidbau/git/seedrandom/seedrandom.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/xor128.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/xorwow.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/xorshift7.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/xor4096.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/tychei.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"],"/home/davidbau/git/seedrandom/lib/alea.js":["f02e18a9-b1c7-4946-836e-c3dbfb9635a3"]},"externalIds":{}}

8
node_modules/seedrandom/.travis.yml generated vendored Normal file
View file

@ -0,0 +1,8 @@
language: node_js
sudo: false
node_js:
- '7'
- '8'
- '9'
- '10'
- '11'

97
node_modules/seedrandom/Gruntfile.js generated vendored Normal file
View file

@ -0,0 +1,97 @@
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
copy: {
browsertest: {
files: [
{ expand: true, cwd: 'node_modules/qunit/qunit', src: 'qunit.*' ,
dest: 'test/lib'},
{ expand: true, cwd: 'node_modules/requirejs', src: 'require.js',
dest: 'test/lib'}
],
}
},
uglify: {
all: {
files: {
"<%= pkg.name %>.min.js": [ "<%= pkg.name %>.js" ],
"lib/alea.min.js": [ "lib/alea.js" ],
"lib/tychei.min.js": [ "lib/tychei.js" ],
"lib/xor4096.min.js": [ "lib/xor4096.js" ],
"lib/xorshift7.min.js": [ "lib/xorshift7.js" ],
"lib/xorwow.min.js": [ "lib/xorwow.js" ],
"lib/xor128.min.js": [ "lib/xor128.js" ]
},
options: {
preserveComments: false,
report: "min",
output: {
ascii_only: true
}
}
}
},
qunit: {
options: {
noGlobals: true,
httpBase: 'http://localhost:8192'
},
all: ["test/*.html"]
},
connect: {
server: {
options: {
port: 8192,
base: '.'
}
}
},
browserify: {
test: {
files: {
'test/browserified.js': ['test/nodetest.js'],
},
options: {
ignore: ['requirejs', 'process'],
alias: {
'assert': './test/qunitassert.js'
}
}
}
},
mocha_nyc: {
coverage: {
src: 'test/*test.js'
},
coveralls: {
src: 'test/*test.js',
options: {
coverage: true
}
}
},
release: {
options: {
bump: false
}
}
});
grunt.event.on('coverage', require('coveralls').handleInput);
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-mocha-nyc');
grunt.loadNpmTasks('grunt-release');
grunt.loadNpmTasks('grunt-browserify');
grunt.registerTask("test", ["copy:browsertest", "browserify",
"connect", "qunit", "mocha_nyc:coverage"]);
grunt.registerTask("default", ["uglify", "test"]);
grunt.registerTask("travis", ["default", "mocha_nyc:coveralls"]);
};

322
node_modules/seedrandom/README.md generated vendored Normal file
View file

@ -0,0 +1,322 @@
seedrandom.js
=============
[![Build Status](https://travis-ci.org/davidbau/seedrandom.svg?branch=master)](https://travis-ci.org/davidbau/seedrandom)
[![NPM version](https://badge.fury.io/js/seedrandom.svg)](http://badge.fury.io/js/seedrandom)
[![Bower version](https://badge.fury.io/bo/seedrandom.svg)](http://badge.fury.io/bo/seedrandom)
Seeded random number generator for JavaScript.
Version 3.0.5
Author: David Bau
Date: 2019-09-14
Can be used as a plain script, a Node.js module or an AMD module.
Script tag usage
----------------
```html
<script src="//cdnjs.cloudflare.com/ajax/libs/seedrandom/3.0.5/seedrandom.min.js">
</script>
```
```js
// Make a predictable pseudorandom number generator.
var myrng = new Math.seedrandom('hello.');
console.log(myrng()); // Always 0.9282578795792454
console.log(myrng()); // Always 0.3752569768646784
// Use "quick" to get only 32 bits of randomness in a float.
console.log(myrng.quick()); // Always 0.7316977467853576
// Use "int32" to get a 32 bit (signed) integer
console.log(myrng.int32()); // Always 1966374204
// Calling seedrandom with no arguments creates an ARC4-based PRNG
// that is autoseeded using the current time, dom state, and other
// accumulated local entropy.
var prng = new Math.seedrandom();
console.log(prng()); // Reasonably unpredictable.
// Seeds using the given explicit seed mixed with accumulated entropy.
prng = new Math.seedrandom('added entropy.', { entropy: true });
console.log(prng()); // As unpredictable as added entropy.
// Warning: if you call Math.seedrandom without `new`, it replaces
// Math.random with the predictable new Math.seedrandom(...), as follows:
Math.seedrandom('hello.');
console.log(Math.random()); // Always 0.9282578795792454
console.log(Math.random()); // Always 0.3752569768646784
```
**Note**: calling `Math.seedrandom('constant')` without `new` will make
`Math.random()` predictable globally, which is intended to be useful for
derandomizing code for testing, but should not be done in a production library.
If you need a local seeded PRNG, use `myrng = new Math.seedrandom('seed')`
instead. For example, [cryptico](https://www.npmjs.com/package/cryptico),
an RSA encryption package, [uses the wrong form](
https://github.com/wwwtyro/cryptico/blob/9291ece6/api.js#L264),
and thus secretly makes `Math.random()` perfectly predictable.
The cryptico library (and any other library that does this)
should not be trusted in a security-sensitive application.
Other Fast PRNG Algorithms
--------------------------
The package includes some other fast PRNGs. To use Johannes Baagøe's
extremely fast Alea PRNG:
```html
<script src="//cdnjs.cloudflare.com/ajax/libs/seedrandom/3.0.5/lib/alea.min.js">
</script>
```
```js
// Use alea for Johannes Baagøe's clever and fast floating-point RNG.
var arng = new alea('hello.');
// By default provides 32 bits of randomness in a float.
console.log(arng()); // Always 0.4783254903741181
// Use "double" to get 56 bits of randomness.
console.log(arng.double()); // Always 0.8297006866124559
// Use "int32" to get a 32 bit (signed) integer.
console.log(arng.int32()); // Always 1076136327
```
Besides alea, there are several other faster PRNGs available.
Note that none of these fast PRNGs provide autoseeding: you
need to provide your own seed (or use the default autoseeded
seedrandom to make a seed).
|PRNG name | Time vs native | Period | Author |
|-----------|----------------|-------------|----------------------|
|`alea` | 1.95 ns, 0.9x | ~2^116 | Baagøe |
|`xor128` | 2.04 ns, 0.9x | 2^128-1 | Marsaglia |
|`tychei` | 2.32 ns, 1.1x | ~2^127 | Neves/Araujo (ChaCha)|
|`xorwow` | 2.40 ns, 1.1x | 2^192-2^32 | Marsaglia |
|`xor4096` | 2.40 ns, 1.1x | 2^4096-2^32 | Brent (xorgens) |
|`xorshift7`| 2.64 ns, 1.3x | 2^256-1 | Panneton/L'ecuyer |
|`quick` | 3.80 ns, 1.8x | ~2^1600 | Bau (ARC4) |
(Timings were done on node v0.12.2 on a single-core Google Compute Engine
instance. `quick` is just the 32-bit version of the RC4-based PRNG
originally packaged with seedrandom.)
CJS / Node.js usage
-------------------
```
npm install seedrandom
```
```js
// Local PRNG: does not affect Math.random.
var seedrandom = require('seedrandom');
var rng = seedrandom('hello.');
console.log(rng()); // Always 0.9282578795792454
// Global PRNG: set Math.random.
seedrandom('hello.', { global: true });
console.log(Math.random()); // Always 0.9282578795792454
// Autoseeded ARC4-based PRNG.
rng = seedrandom();
console.log(rng()); // Reasonably unpredictable.
// Mixing accumulated entropy.
rng = seedrandom('added entropy.', { entropy: true });
console.log(rng()); // As unpredictable as added entropy.
// Using alternate algorithms, as listed above.
var rng2 = seedrandom.xor4096('hello.')
console.log(rng2());
```
Starting in version 3, when using via require('seedrandom'), the global
`Math.seedrandom` is no longer available.
Require.js usage
----------------
Similar to Node.js usage:
```
bower install seedrandom
```
```
require(['seedrandom'], function(seedrandom) {
var rng = seedrandom('hello.');
console.log(rng()); // Always 0.9282578795792454
});
```
Network seeding
---------------
```html
<script src=//cdnjs.cloudflare.com/ajax/libs/seedrandom/3.0.5/seedrandom.min.js>
</script>
<!-- Seeds using urandom bits from a server. -->
<script src=//jsonlib.appspot.com/urandom?callback=Math.seedrandom>
</script>
<!-- Seeds mixing in random.org bits -->
<script>
(function(x, u, s){
try {
// Make a synchronous request to random.org.
x.open('GET', u, false);
x.send();
s = unescape(x.response.trim().replace(/^|\s/g, '%'));
} finally {
// Seed with the response, or autoseed on failure.
Math.seedrandom(s, !!s);
}
})(new XMLHttpRequest, 'https://www.random.org/integers/' +
'?num=256&min=0&max=255&col=1&base=16&format=plain&rnd=new');
</script>
```
Reseeding using user input
--------------------------
```js
var seed = Math.seedrandom(); // Use prng with an automatic seed.
document.write(Math.random()); // Pretty much unpredictable x.
var rng = new Math.seedrandom(seed); // A new prng with the same seed.
document.write(rng()); // Repeat the 'unpredictable' x.
function reseed(event, count) { // Define a custom entropy collector.
var t = [];
function w(e) {
t.push([e.pageX, e.pageY, +new Date]);
if (t.length < count) { return; }
document.removeEventListener(event, w);
Math.seedrandom(t, { entropy: true });
}
document.addEventListener(event, w);
}
reseed('mousemove', 100); // Reseed after 100 mouse moves.
```
The "pass" option can be used to get both the prng and the seed.
The following returns both an autoseeded prng and the seed as an object,
without mutating Math.random:
```js
var obj = Math.seedrandom(null, { pass: function(prng, seed) {
return { random: prng, seed: seed };
}});
```
Saving and Restoring PRNG state
-------------------------------
```js
var seedrandom = Math.seedrandom;
var saveable = seedrandom("secret-seed", {state: true});
for (var j = 0; j < 1e5; ++j) saveable();
var saved = saveable.state();
var replica = seedrandom("", {state: saved});
assert(replica() == saveable());
```
In normal use the prng is opaque and its internal state cannot be accessed.
However, if the "state" option is specified, the prng gets a state() method
that returns a plain object the can be used to reconstruct a prng later in
the same state (by passing that saved object back as the state option).
Version notes
-------------
The random number sequence is the same as version 1.0 for string seeds.
* Version 2.0 changed the sequence for non-string seeds.
* Version 2.1 speeds seeding and uses window.crypto to autoseed if present.
* Version 2.2 alters non-crypto autoseeding to sweep up entropy from plugins.
* Version 2.3 adds support for "new", module loading, and a null seed arg.
* Version 2.3.1 adds a build environment, module packaging, and tests.
* Version 2.3.4 fixes bugs on IE8, and switches to MIT license.
* Version 2.3.6 adds a readable options object argument.
* Version 2.3.10 adds support for node.js crypto (contributed by ctd1500).
* Version 2.3.11 adds an option to load and save internal state.
* Version 2.4.0 adds implementations of several other fast PRNGs.
* Version 2.4.2 adds an implementation of Baagoe's very fast Alea PRNG.
* Version 2.4.3 ignores nodejs crypto when under browserify.
* Version 2.4.4 avoids strict mode problem with global this reference.
* Version 3.0.1 removes Math.seedrandom for require('seedrandom') users.
* Version 3.0.3 updates package.json for CDN entrypoints.
* Version 3.0.5 removes eval to avoid triggering content-security policy.
The standard ARC4 key scheduler cycles short keys, which means that
seedrandom('ab') is equivalent to seedrandom('abab') and 'ababab'.
Therefore it is a good idea to add a terminator to avoid trivial
equivalences on short string seeds, e.g., Math.seedrandom(str + '\0').
Starting with version 2.0, a terminator is added automatically for
non-string seeds, so seeding with the number 111 is the same as seeding
with '111\0'.
When seedrandom() is called with zero args or a null seed, it uses a
seed drawn from the browser crypto object if present. If there is no
crypto support, seedrandom() uses the current time, the native rng,
and a walk of several DOM objects to collect a few bits of entropy.
Each time the one- or two-argument forms of seedrandom are called,
entropy from the passed seed is accumulated in a pool to help generate
future seeds for the zero- and two-argument forms of seedrandom.
On speed - This javascript implementation of Math.random() is several
times slower than the built-in Math.random() because it is not native
code, but that is typically fast enough. Some details (timings on
Chrome 25 on a 2010 vintage macbook):
* seeded Math.random() - avg less than 0.0002 milliseconds per call
* seedrandom('explicit.') - avg less than 0.2 milliseconds per call
* seedrandom('explicit.', true) - avg less than 0.2 milliseconds per call
* seedrandom() with crypto - avg less than 0.2 milliseconds per call
Autoseeding without crypto is somewhat slow, about 20-30 milliseconds on
a 2012 windows 7 1.5ghz i5 laptop, as seen on Firefox 19, IE 10, and Opera.
Seeded rng calls themselves are fast across these browsers, with slowest
numbers on Opera at about 0.0005 ms per seeded Math.random().
LICENSE (MIT)
-------------
Copyright 2019 David Bau.
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.

16
node_modules/seedrandom/bower.json generated vendored Normal file
View file

@ -0,0 +1,16 @@
{
"name": "seedrandom",
"description": "Seeded random number generator for Javascript.",
"main": "seedrandom.js",
"license": "MIT",
"keywords": [
"random",
"seed",
"crypto"
],
"ignore": [],
"devDependencies": {
"qunit": "latest",
"requirejs": "latest"
}
}

10
node_modules/seedrandom/component.json generated vendored Normal file
View file

@ -0,0 +1,10 @@
{
"name": "seedrandom",
"version": "3.0.0",
"description": "Seeded random number generator for Javascript",
"repository": "davidbau/seedrandom",
"main": "seedrandom.js",
"scripts": [ "seedrandom.js" ],
"keywords": [ "random", "seed", "crypto" ],
"license": "MIT"
}

1
node_modules/seedrandom/coverage/coverage.json generated vendored Normal file

File diff suppressed because one or more lines are too long

224
node_modules/seedrandom/coverage/lcov-report/base.css generated vendored Normal file
View file

@ -0,0 +1,224 @@
body, html {
margin:0; padding: 0;
height: 100%;
}
body {
font-family: Helvetica Neue, Helvetica, Arial;
font-size: 14px;
color:#333;
}
.small { font-size: 12px; }
*, *:after, *:before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
h1 { font-size: 20px; margin: 0;}
h2 { font-size: 14px; }
pre {
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
margin: 0;
padding: 0;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
a { color:#0074D9; text-decoration:none; }
a:hover { text-decoration:underline; }
.strong { font-weight: bold; }
.space-top1 { padding: 10px 0 0 0; }
.pad2y { padding: 20px 0; }
.pad1y { padding: 10px 0; }
.pad2x { padding: 0 20px; }
.pad2 { padding: 20px; }
.pad1 { padding: 10px; }
.space-left2 { padding-left:55px; }
.space-right2 { padding-right:20px; }
.center { text-align:center; }
.clearfix { display:block; }
.clearfix:after {
content:'';
display:block;
height:0;
clear:both;
visibility:hidden;
}
.fl { float: left; }
@media only screen and (max-width:640px) {
.col3 { width:100%; max-width:100%; }
.hide-mobile { display:none!important; }
}
.quiet {
color: #7f7f7f;
color: rgba(0,0,0,0.5);
}
.quiet a { opacity: 0.7; }
.fraction {
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
font-size: 10px;
color: #555;
background: #E8E8E8;
padding: 4px 5px;
border-radius: 3px;
vertical-align: middle;
}
div.path a:link, div.path a:visited { color: #333; }
table.coverage {
border-collapse: collapse;
margin: 10px 0 0 0;
padding: 0;
}
table.coverage td {
margin: 0;
padding: 0;
vertical-align: top;
}
table.coverage td.line-count {
text-align: right;
padding: 0 5px 0 20px;
}
table.coverage td.line-coverage {
text-align: right;
padding-right: 10px;
min-width:20px;
}
table.coverage td span.cline-any {
display: inline-block;
padding: 0 5px;
width: 100%;
}
.missing-if-branch {
display: inline-block;
margin-right: 5px;
border-radius: 3px;
position: relative;
padding: 0 4px;
background: #333;
color: yellow;
}
.skip-if-branch {
display: none;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: #ccc;
color: white;
}
.missing-if-branch .typ, .skip-if-branch .typ {
color: inherit !important;
}
.coverage-summary {
border-collapse: collapse;
width: 100%;
}
.coverage-summary tr { border-bottom: 1px solid #bbb; }
.keyline-all { border: 1px solid #ddd; }
.coverage-summary td, .coverage-summary th { padding: 10px; }
.coverage-summary tbody { border: 1px solid #bbb; }
.coverage-summary td { border-right: 1px solid #bbb; }
.coverage-summary td:last-child { border-right: none; }
.coverage-summary th {
text-align: left;
font-weight: normal;
white-space: nowrap;
}
.coverage-summary th.file { border-right: none !important; }
.coverage-summary th.pct { }
.coverage-summary th.pic,
.coverage-summary th.abs,
.coverage-summary td.pct,
.coverage-summary td.abs { text-align: right; }
.coverage-summary td.file { white-space: nowrap; }
.coverage-summary td.pic { min-width: 120px !important; }
.coverage-summary tfoot td { }
.coverage-summary .sorter {
height: 10px;
width: 7px;
display: inline-block;
margin-left: 0.5em;
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
}
.coverage-summary .sorted .sorter {
background-position: 0 -20px;
}
.coverage-summary .sorted-desc .sorter {
background-position: 0 -10px;
}
.status-line { height: 10px; }
/* yellow */
.cbranch-no { background: yellow !important; color: #111; }
/* dark red */
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
.low .chart { border:1px solid #C21F39 }
.highlighted,
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
background: #C21F39 !important;
}
/* medium red */
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
/* light red */
.low, .cline-no { background:#FCE1E5 }
/* light green */
.high, .cline-yes { background:rgb(230,245,208) }
/* medium green */
.cstat-yes { background:rgb(161,215,106) }
/* dark green */
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
.high .chart { border:1px solid rgb(77,146,33) }
/* dark yellow (gold) */
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
.medium .chart { border:1px solid #f9cd0b; }
/* light yellow */
.medium { background: #fff4c2; }
.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }
span.cline-neutral { background: #eaeaea; }
.coverage-summary td.empty {
opacity: .5;
padding-top: 4px;
padding-bottom: 4px;
line-height: 1;
color: #888;
}
.cover-fill, .cover-empty {
display:inline-block;
height: 12px;
}
.chart {
line-height: 0;
}
.cover-empty {
background: white;
}
.cover-full {
border-right: none !important;
}
pre.prettyprint {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.com { color: #999 !important; }
.ignore-none { color: #999; font-weight: normal; }
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -48px;
}
.footer, .push {
height: 48px;
}

View file

@ -0,0 +1,79 @@
/* eslint-disable */
var jumpToCode = (function init() {
// Classes of code we would like to highlight in the file view
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
// Elements to highlight in the file listing view
var fileListingElements = ['td.pct.low'];
// We don't want to select elements that are direct descendants of another match
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
// Selecter that finds elements on the page to which we can jump
var selector =
fileListingElements.join(', ') +
', ' +
notSelector +
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
// The NodeList of matching elements
var missingCoverageElements = document.querySelectorAll(selector);
var currentIndex;
function toggleClass(index) {
missingCoverageElements
.item(currentIndex)
.classList.remove('highlighted');
missingCoverageElements.item(index).classList.add('highlighted');
}
function makeCurrent(index) {
toggleClass(index);
currentIndex = index;
missingCoverageElements.item(index).scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'center'
});
}
function goToPrevious() {
var nextIndex = 0;
if (typeof currentIndex !== 'number' || currentIndex === 0) {
nextIndex = missingCoverageElements.length - 1;
} else if (missingCoverageElements.length > 1) {
nextIndex = currentIndex - 1;
}
makeCurrent(nextIndex);
}
function goToNext() {
var nextIndex = 0;
if (
typeof currentIndex === 'number' &&
currentIndex < missingCoverageElements.length - 1
) {
nextIndex = currentIndex + 1;
}
makeCurrent(nextIndex);
}
return function jump(event) {
switch (event.which) {
case 78: // n
case 74: // j
goToNext();
break;
case 66: // b
case 75: // k
case 80: // p
goToPrevious();
break;
}
};
})();
window.addEventListener('keydown', jumpToCode);

110
node_modules/seedrandom/coverage/lcov-report/index.html generated vendored Normal file
View file

@ -0,0 +1,110 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for All files</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
All files
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">93.21% </span>
<span class="quiet">Statements</span>
<span class='fraction'>439/471</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">73.2% </span>
<span class="quiet">Branches</span>
<span class='fraction'>142/194</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">90.41% </span>
<span class="quiet">Functions</span>
<span class='fraction'>66/73</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">94.44% </span>
<span class="quiet">Lines</span>
<span class='fraction'>374/396</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="seedrandom"><a href="seedrandom/index.html">seedrandom</a></td>
<td data-value="96" class="pic high"><div class="chart"><div class="cover-fill" style="width: 96%;"></div><div class="cover-empty" style="width:4%;"></div></div></td>
<td data-value="96" class="pct high">96%</td>
<td data-value="100" class="abs high">96/100</td>
<td data-value="85.11" class="pct high">85.11%</td>
<td data-value="47" class="abs high">40/47</td>
<td data-value="93.33" class="pct high">93.33%</td>
<td data-value="15" class="abs high">14/15</td>
<td data-value="96.39" class="pct high">96.39%</td>
<td data-value="83" class="abs high">80/83</td>
</tr>
<tr>
<td class="file high" data-value="seedrandom/lib"><a href="seedrandom/lib/index.html">seedrandom/lib</a></td>
<td data-value="92.45" class="pic high"><div class="chart"><div class="cover-fill" style="width: 92%;"></div><div class="cover-empty" style="width:8%;"></div></div></td>
<td data-value="92.45" class="pct high">92.45%</td>
<td data-value="371" class="abs high">343/371</td>
<td data-value="69.39" class="pct medium">69.39%</td>
<td data-value="147" class="abs medium">102/147</td>
<td data-value="89.66" class="pct high">89.66%</td>
<td data-value="58" class="abs high">52/58</td>
<td data-value="93.93" class="pct high">93.93%</td>
<td data-value="313" class="abs high">294/313</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,97 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for seedrandom</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../index.html">All files</a> seedrandom
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">96% </span>
<span class="quiet">Statements</span>
<span class='fraction'>96/100</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">85.11% </span>
<span class="quiet">Branches</span>
<span class='fraction'>40/47</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">93.33% </span>
<span class="quiet">Functions</span>
<span class='fraction'>14/15</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">96.39% </span>
<span class="quiet">Lines</span>
<span class='fraction'>80/83</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="seedrandom.js"><a href="seedrandom.js.html">seedrandom.js</a></td>
<td data-value="96" class="pic high"><div class="chart"><div class="cover-fill" style="width: 96%;"></div><div class="cover-empty" style="width:4%;"></div></div></td>
<td data-value="96" class="pct high">96%</td>
<td data-value="100" class="abs high">96/100</td>
<td data-value="85.11" class="pct high">85.11%</td>
<td data-value="47" class="abs high">40/47</td>
<td data-value="93.33" class="pct high">93.33%</td>
<td data-value="15" class="abs high">14/15</td>
<td data-value="96.39" class="pct high">96.39%</td>
<td data-value="83" class="abs high">80/83</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,411 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for seedrandom/lib/alea.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../../index.html">All files</a> / <a href="index.html">seedrandom/lib</a> alea.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">91.94% </span>
<span class="quiet">Statements</span>
<span class='fraction'>57/62</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">66.67% </span>
<span class="quiet">Branches</span>
<span class='fraction'>16/24</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">90.91% </span>
<span class="quiet">Functions</span>
<span class='fraction'>10/11</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">94.34% </span>
<span class="quiet">Lines</span>
<span class='fraction'>50/53</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// A port of an algorithm by Johannes Baagøe &lt;baagoe@baagoe.com&gt;, 2010
// http://baagoe.com/en/RandomMusings/javascript/
// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror
// Original work is under MIT license -
&nbsp;
// Copyright (C) 2010 by Johannes Baagøe &lt;baagoe@baagoe.org&gt;
//
// 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.
&nbsp;
&nbsp;
&nbsp;
(function(global, module, define) {
&nbsp;
function Alea(seed) {
var me = this, mash = Mash();
&nbsp;
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);
};
&nbsp;
// 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 &lt; 0) { me.s0 += 1; }
me.s1 -= mash(seed);
<span class="missing-if-branch" title="else path not taken" >E</span>if (me.s1 &lt; 0) { me.s1 += 1; }
me.s2 -= mash(seed);
<span class="missing-if-branch" title="if path not taken" >I</span>if (me.s2 &lt; 0) { <span class="cstat-no" title="statement not covered" >me.s2 += 1; </span>}
mash = null;
}
&nbsp;
function copy(f, t) {
t.c = f.c;
t.s0 = f.s0;
t.s1 = f.s1;
t.s2 = f.s2;
return t;
}
&nbsp;
function impl(seed, opts) {
var xg = new Alea(seed),
state = opts &amp;&amp; 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;
}
&nbsp;
function Mash() {
var n = 0xefc8249d;
&nbsp;
var mash = function(data) {
data = String(data);
for (var i = 0; i &lt; data.length; i++) {
n += data.charCodeAt(i);
var h = 0.02519603282416938 * n;
n = h &gt;&gt;&gt; 0;
h -= n;
h *= n;
n = h &gt;&gt;&gt; 0;
h -= n;
n += h * 0x100000000; // 2^32
}
return (n &gt;&gt;&gt; 0) * 2.3283064365386963e-10; // 2^-32
};
&nbsp;
return mash;
}
&nbsp;
&nbsp;
<span class="missing-if-branch" title="else path not taken" >E</span>if (module &amp;&amp; module.exports) {
module.exports = impl;
} else <span class="cstat-no" title="statement not covered" >if (define &amp;&amp; define.amd) {</span>
<span class="cstat-no" title="statement not covered" > define(<span class="fstat-no" title="function not covered" >fu</span>nction() { <span class="cstat-no" title="statement not covered" >return impl; </span>});</span>
} else {
<span class="cstat-no" title="statement not covered" > this.alea = impl;</span>
}
&nbsp;
})(
this,
(typeof module) == 'object' &amp;&amp; module, // present in node.js
(typeof define) == 'function' &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >define </span> // present with an AMD loader
);
&nbsp;
&nbsp;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,162 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for seedrandom/lib</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../../index.html">All files</a> seedrandom/lib
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">92.45% </span>
<span class="quiet">Statements</span>
<span class='fraction'>343/371</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">69.39% </span>
<span class="quiet">Branches</span>
<span class='fraction'>102/147</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">89.66% </span>
<span class="quiet">Functions</span>
<span class='fraction'>52/58</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">93.93% </span>
<span class="quiet">Lines</span>
<span class='fraction'>294/313</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="alea.js"><a href="alea.js.html">alea.js</a></td>
<td data-value="91.94" class="pic high"><div class="chart"><div class="cover-fill" style="width: 91%;"></div><div class="cover-empty" style="width:9%;"></div></div></td>
<td data-value="91.94" class="pct high">91.94%</td>
<td data-value="62" class="abs high">57/62</td>
<td data-value="66.67" class="pct medium">66.67%</td>
<td data-value="24" class="abs medium">16/24</td>
<td data-value="90.91" class="pct high">90.91%</td>
<td data-value="11" class="abs high">10/11</td>
<td data-value="94.34" class="pct high">94.34%</td>
<td data-value="53" class="abs high">50/53</td>
</tr>
<tr>
<td class="file high" data-value="tychei.js"><a href="tychei.js.html">tychei.js</a></td>
<td data-value="92.98" class="pic high"><div class="chart"><div class="cover-fill" style="width: 92%;"></div><div class="cover-empty" style="width:8%;"></div></div></td>
<td data-value="92.98" class="pct high">92.98%</td>
<td data-value="57" class="abs high">53/57</td>
<td data-value="70" class="pct medium">70%</td>
<td data-value="20" class="abs medium">14/20</td>
<td data-value="88.89" class="pct high">88.89%</td>
<td data-value="9" class="abs high">8/9</td>
<td data-value="93.75" class="pct high">93.75%</td>
<td data-value="48" class="abs high">45/48</td>
</tr>
<tr>
<td class="file high" data-value="xor128.js"><a href="xor128.js.html">xor128.js</a></td>
<td data-value="91.84" class="pic high"><div class="chart"><div class="cover-fill" style="width: 91%;"></div><div class="cover-empty" style="width:9%;"></div></div></td>
<td data-value="91.84" class="pct high">91.84%</td>
<td data-value="49" class="abs high">45/49</td>
<td data-value="70" class="pct medium">70%</td>
<td data-value="20" class="abs medium">14/20</td>
<td data-value="88.89" class="pct high">88.89%</td>
<td data-value="9" class="abs high">8/9</td>
<td data-value="93.02" class="pct high">93.02%</td>
<td data-value="43" class="abs high">40/43</td>
</tr>
<tr>
<td class="file high" data-value="xor4096.js"><a href="xor4096.js.html">xor4096.js</a></td>
<td data-value="92.68" class="pic high"><div class="chart"><div class="cover-fill" style="width: 92%;"></div><div class="cover-empty" style="width:8%;"></div></div></td>
<td data-value="92.68" class="pct high">92.68%</td>
<td data-value="82" class="abs high">76/82</td>
<td data-value="65.71" class="pct medium">65.71%</td>
<td data-value="35" class="abs medium">23/35</td>
<td data-value="90" class="pct high">90%</td>
<td data-value="10" class="abs high">9/10</td>
<td data-value="94.52" class="pct high">94.52%</td>
<td data-value="73" class="abs high">69/73</td>
</tr>
<tr>
<td class="file high" data-value="xorshift7.js"><a href="xorshift7.js.html">xorshift7.js</a></td>
<td data-value="92.42" class="pic high"><div class="chart"><div class="cover-fill" style="width: 92%;"></div><div class="cover-empty" style="width:8%;"></div></div></td>
<td data-value="92.42" class="pct high">92.42%</td>
<td data-value="66" class="abs high">61/66</td>
<td data-value="73.08" class="pct medium">73.08%</td>
<td data-value="26" class="abs medium">19/26</td>
<td data-value="90" class="pct high">90%</td>
<td data-value="10" class="abs high">9/10</td>
<td data-value="94" class="pct high">94%</td>
<td data-value="50" class="abs high">47/50</td>
</tr>
<tr>
<td class="file high" data-value="xorwow.js"><a href="xorwow.js.html">xorwow.js</a></td>
<td data-value="92.73" class="pic high"><div class="chart"><div class="cover-fill" style="width: 92%;"></div><div class="cover-empty" style="width:8%;"></div></div></td>
<td data-value="92.73" class="pct high">92.73%</td>
<td data-value="55" class="abs high">51/55</td>
<td data-value="72.73" class="pct medium">72.73%</td>
<td data-value="22" class="abs medium">16/22</td>
<td data-value="88.89" class="pct high">88.89%</td>
<td data-value="9" class="abs high">8/9</td>
<td data-value="93.48" class="pct high">93.48%</td>
<td data-value="46" class="abs high">43/46</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,378 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for seedrandom/lib/tychei.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../../index.html">All files</a> / <a href="index.html">seedrandom/lib</a> tychei.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">92.98% </span>
<span class="quiet">Statements</span>
<span class='fraction'>53/57</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">70% </span>
<span class="quiet">Branches</span>
<span class='fraction'>14/20</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">88.89% </span>
<span class="quiet">Functions</span>
<span class='fraction'>8/9</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">93.75% </span>
<span class="quiet">Lines</span>
<span class='fraction'>45/48</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">4105195x</span>
<span class="cline-any cline-yes">4105195x</span>
<span class="cline-any cline-yes">4105195x</span>
<span class="cline-any cline-yes">4105195x</span>
<span class="cline-any cline-yes">4105195x</span>
<span class="cline-any cline-yes">4105195x</span>
<span class="cline-any cline-yes">4105195x</span>
<span class="cline-any cline-yes">4105195x</span>
<span class="cline-any cline-yes">4105195x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">66x</span>
<span class="cline-any cline-yes">66x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">4102054x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// 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
&nbsp;
(function(global, module, define) {
&nbsp;
function XorGen(seed) {
var me = this, strseed = '';
&nbsp;
// Set up generator function.
me.next = function() {
var b = me.b, c = me.c, d = me.d, a = me.a;
b = (b &lt;&lt; 25) ^ (b &gt;&gt;&gt; 7) ^ c;
c = (c - d) | 0;
d = (d &lt;&lt; 24) ^ (d &gt;&gt;&gt; 8) ^ a;
a = (a - b) | 0;
me.b = b = (b &lt;&lt; 20) ^ (b &gt;&gt;&gt; 12) ^ c;
me.c = c = (c - d) | 0;
me.d = (d &lt;&lt; 16) ^ (c &gt;&gt;&gt; 16) ^ a;
return me.a = (a - b) | 0;
};
&nbsp;
/* 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) &gt;&gt;&gt; 0;
d = me.d ^ a; d = d &lt;&lt; 16 ^ d &gt;&gt;&gt; 16;
c = me.c + d | 0;
b = me.b ^ c; b = b &lt;&lt; 12 ^ d &gt;&gt;&gt; 20;
me.a = a = a + b | 0;
d = d ^ a; me.d = d = d &lt;&lt; 8 ^ d &gt;&gt;&gt; 24;
me.c = c = c + d | 0;
b = b ^ c;
return me.b = (b &lt;&lt; 7 ^ b &gt;&gt;&gt; 25);
}
*/
&nbsp;
me.a = 0;
me.b = 0;
me.c = 2654435769 | 0;
me.d = 1367130551;
&nbsp;
if (seed === Math.floor(seed)) {
// Integer seed.
me.a = (seed / 0x100000000) | 0;
me.b = seed | 0;
} else {
// String seed.
strseed += seed;
}
&nbsp;
// Mix in string seed, then discard an initial batch of 64 values.
for (var k = 0; k &lt; strseed.length + 20; k++) {
me.b ^= strseed.charCodeAt(k) | 0;
me.next();
}
}
&nbsp;
function copy(f, t) {
t.a = f.a;
t.b = f.b;
t.c = f.c;
t.d = f.d;
return t;
};
&nbsp;
function impl(seed, opts) {
var xg = new XorGen(seed),
state = opts &amp;&amp; opts.state,
prng = function() { return (xg.next() &gt;&gt;&gt; 0) / 0x100000000; };
prng.double = function() {
do {
var top = xg.next() &gt;&gt;&gt; 11,
bot = (xg.next() &gt;&gt;&gt; 0) / 0x100000000,
result = (top + bot) / (1 &lt;&lt; 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;
}
&nbsp;
<span class="missing-if-branch" title="else path not taken" >E</span>if (module &amp;&amp; module.exports) {
module.exports = impl;
} else <span class="cstat-no" title="statement not covered" >if (define &amp;&amp; define.amd) {</span>
<span class="cstat-no" title="statement not covered" > define(<span class="fstat-no" title="function not covered" >fu</span>nction() { <span class="cstat-no" title="statement not covered" >return impl; </span>});</span>
} else {
<span class="cstat-no" title="statement not covered" > this.tychei = impl;</span>
}
&nbsp;
})(
this,
(typeof module) == 'object' &amp;&amp; module, // present in node.js
(typeof define) == 'function' &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >define </span> // present with an AMD loader
);
&nbsp;
&nbsp;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,312 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for seedrandom/lib/xor128.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../../index.html">All files</a> / <a href="index.html">seedrandom/lib</a> xor128.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">91.84% </span>
<span class="quiet">Statements</span>
<span class='fraction'>45/49</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">70% </span>
<span class="quiet">Branches</span>
<span class='fraction'>14/20</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">88.89% </span>
<span class="quiet">Functions</span>
<span class='fraction'>8/9</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">93.02% </span>
<span class="quiet">Lines</span>
<span class='fraction'>40/43</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">4105327x</span>
<span class="cline-any cline-yes">4105327x</span>
<span class="cline-any cline-yes">4105327x</span>
<span class="cline-any cline-yes">4105327x</span>
<span class="cline-any cline-yes">4105327x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">198x</span>
<span class="cline-any cline-yes">198x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">4102054x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// A Javascript implementaion of the "xor128" prng algorithm by
// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper
&nbsp;
(function(global, module, define) {
&nbsp;
function XorGen(seed) {
var me = this, strseed = '';
&nbsp;
me.x = 0;
me.y = 0;
me.z = 0;
me.w = 0;
&nbsp;
// Set up generator function.
me.next = function() {
var t = me.x ^ (me.x &lt;&lt; 11);
me.x = me.y;
me.y = me.z;
me.z = me.w;
return me.w ^= (me.w &gt;&gt;&gt; 19) ^ t ^ (t &gt;&gt;&gt; 8);
};
&nbsp;
if (seed === (seed | 0)) {
// Integer seed.
me.x = seed;
} else {
// String seed.
strseed += seed;
}
&nbsp;
// Mix in string seed, then discard an initial batch of 64 values.
for (var k = 0; k &lt; strseed.length + 64; k++) {
me.x ^= strseed.charCodeAt(k) | 0;
me.next();
}
}
&nbsp;
function copy(f, t) {
t.x = f.x;
t.y = f.y;
t.z = f.z;
t.w = f.w;
return t;
}
&nbsp;
function impl(seed, opts) {
var xg = new XorGen(seed),
state = opts &amp;&amp; opts.state,
prng = function() { return (xg.next() &gt;&gt;&gt; 0) / 0x100000000; };
prng.double = function() {
do {
var top = xg.next() &gt;&gt;&gt; 11,
bot = (xg.next() &gt;&gt;&gt; 0) / 0x100000000,
result = (top + bot) / (1 &lt;&lt; 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;
}
&nbsp;
<span class="missing-if-branch" title="else path not taken" >E</span>if (module &amp;&amp; module.exports) {
module.exports = impl;
} else <span class="cstat-no" title="statement not covered" >if (define &amp;&amp; define.amd) {</span>
<span class="cstat-no" title="statement not covered" > define(<span class="fstat-no" title="function not covered" >fu</span>nction() { <span class="cstat-no" title="statement not covered" >return impl; </span>});</span>
} else {
<span class="cstat-no" title="statement not covered" > this.xor128 = impl;</span>
}
&nbsp;
})(
this,
(typeof module) == 'object' &amp;&amp; module, // present in node.js
(typeof define) == 'function' &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >define </span> // present with an AMD loader
);
&nbsp;
&nbsp;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,507 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for seedrandom/lib/xor4096.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../../index.html">All files</a> / <a href="index.html">seedrandom/lib</a> xor4096.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">92.68% </span>
<span class="quiet">Statements</span>
<span class='fraction'>76/82</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">65.71% </span>
<span class="quiet">Branches</span>
<span class='fraction'>23/35</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">90% </span>
<span class="quiet">Functions</span>
<span class='fraction'>9/10</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">94.52% </span>
<span class="quiet">Lines</span>
<span class='fraction'>69/73</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4105129x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">480x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">480x</span>
<span class="cline-any cline-yes">480x</span>
<span class="cline-any cline-yes">480x</span>
<span class="cline-any cline-yes">480x</span>
<span class="cline-any cline-yes">480x</span>
<span class="cline-any cline-yes">480x</span>
<span class="cline-any cline-yes">384x</span>
<span class="cline-any cline-yes">384x</span>
<span class="cline-any cline-yes">384x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">1536x</span>
<span class="cline-any cline-yes">1536x</span>
<span class="cline-any cline-yes">1536x</span>
<span class="cline-any cline-yes">1536x</span>
<span class="cline-any cline-yes">1536x</span>
<span class="cline-any cline-yes">1536x</span>
<span class="cline-any cline-yes">1536x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">4102054x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// 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().
&nbsp;
(function(global, module, define) {
&nbsp;
function XorGen(seed) {
var me = this;
&nbsp;
// 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) &amp; 127];
t = X[i = ((i + 1) &amp; 127)];
v ^= v &lt;&lt; 13;
t ^= t &lt;&lt; 17;
v ^= v &gt;&gt;&gt; 15;
t ^= t &gt;&gt;&gt; 12;
// Update Xor generator array state.
v = X[i] = v ^ t;
me.i = i;
// Result is the combination.
return (v + (w ^ (w &gt;&gt;&gt; 16))) | 0;
};
&nbsp;
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 &lt; 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 &lt;&lt; 10;
v ^= v &gt;&gt;&gt; 15;
v ^= v &lt;&lt; 4;
v ^= v &gt;&gt;&gt; 13;
if (j &gt;= 0) {
w = (w + 0x61c88647) | 0; // Weyl.
t = (X[j &amp; 127] ^= (v + w)); // Combine xor and weyl to init array.
i = (0 == t) ? <span class="branch-0 cbranch-no" title="branch not covered" >i + 1 </span>: 0; // Count zeroes.
}
}
// We have detected all zeroes; make the key nonzero.
<span class="missing-if-branch" title="if path not taken" >I</span>if (i &gt;= 128) {
<span class="cstat-no" title="statement not covered" > X[(seed &amp;&amp; seed.length || 0) &amp; 127] = -1;</span>
}
// 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 &gt; 0; --j) {
v = X[(i + 34) &amp; 127];
t = X[i = ((i + 1) &amp; 127)];
v ^= v &lt;&lt; 13;
t ^= t &lt;&lt; 17;
v ^= v &gt;&gt;&gt; 15;
t ^= t &gt;&gt;&gt; 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;
}
&nbsp;
init(me, seed);
}
&nbsp;
function copy(f, t) {
t.i = f.i;
t.w = f.w;
t.X = f.X.slice();
return t;
};
&nbsp;
function impl(seed, opts) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (seed == null) <span class="cstat-no" title="statement not covered" >seed = +(new Date);</span>
var xg = new XorGen(seed),
state = opts &amp;&amp; opts.state,
prng = function() { return (xg.next() &gt;&gt;&gt; 0) / 0x100000000; };
prng.double = function() {
do {
var top = xg.next() &gt;&gt;&gt; 11,
bot = (xg.next() &gt;&gt;&gt; 0) / 0x100000000,
result = (top + bot) / (1 &lt;&lt; 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;
}
&nbsp;
<span class="missing-if-branch" title="else path not taken" >E</span>if (module &amp;&amp; module.exports) {
module.exports = impl;
} else <span class="cstat-no" title="statement not covered" >if (define &amp;&amp; define.amd) {</span>
<span class="cstat-no" title="statement not covered" > define(<span class="fstat-no" title="function not covered" >fu</span>nction() { <span class="cstat-no" title="statement not covered" >return impl; </span>});</span>
} else {
<span class="cstat-no" title="statement not covered" > this.xor4096 = impl;</span>
}
&nbsp;
})(
this, // window object or global
(typeof module) == 'object' &amp;&amp; module, // present in node.js
(typeof define) == 'function' &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >define </span> // present with an AMD loader
);
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,360 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for seedrandom/lib/xorshift7.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../../index.html">All files</a> / <a href="index.html">seedrandom/lib</a> xorshift7.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">92.42% </span>
<span class="quiet">Statements</span>
<span class='fraction'>61/66</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">73.08% </span>
<span class="quiet">Branches</span>
<span class='fraction'>19/26</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">90% </span>
<span class="quiet">Functions</span>
<span class='fraction'>9/10</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">94% </span>
<span class="quiet">Lines</span>
<span class='fraction'>47/50</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4105897x</span>
<span class="cline-any cline-yes">4105897x</span>
<span class="cline-any cline-yes">4105897x</span>
<span class="cline-any cline-yes">4105897x</span>
<span class="cline-any cline-yes">4105897x</span>
<span class="cline-any cline-yes">4105897x</span>
<span class="cline-any cline-yes">4105897x</span>
<span class="cline-any cline-yes">4105897x</span>
<span class="cline-any cline-yes">4105897x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">768x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">4102054x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// 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
&nbsp;
(function(global, module, define) {
&nbsp;
function XorGen(seed) {
var me = this;
&nbsp;
// 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 &gt;&gt;&gt; 7); v = t ^ (t &lt;&lt; 24);
t = X[(i + 1) &amp; 7]; v ^= t ^ (t &gt;&gt;&gt; 10);
t = X[(i + 3) &amp; 7]; v ^= t ^ (t &gt;&gt;&gt; 3);
t = X[(i + 4) &amp; 7]; v ^= t ^ (t &lt;&lt; 7);
t = X[(i + 7) &amp; 7]; t = t ^ (t &lt;&lt; 13); v ^= t ^ (t &lt;&lt; 9);
X[i] = v;
me.i = (i + 1) &amp; 7;
return v;
};
&nbsp;
function init(me, seed) {
var j, w, X = [];
&nbsp;
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 &lt; seed.length; ++j) {
X[j &amp; 7] = (X[j &amp; 7] &lt;&lt; 15) ^
(seed.charCodeAt(j) + X[(j + 1) &amp; 7] &lt;&lt; 13);
}
}
// Enforce an array length of 8, not all zeroes.
while (X.length &lt; 8) X.push(0);
for (j = 0; j &lt; 8 &amp;&amp; X[j] === 0; ++j);
if (j == 8) w = X[7] = -1; else w = X[j];
&nbsp;
me.x = X;
me.i = 0;
&nbsp;
// Discard an initial 256 values.
for (j = 256; j &gt; 0; --j) {
me.next();
}
}
&nbsp;
init(me, seed);
}
&nbsp;
function copy(f, t) {
t.x = f.x.slice();
t.i = f.i;
return t;
}
&nbsp;
function impl(seed, opts) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (seed == null) <span class="cstat-no" title="statement not covered" >seed = +(new Date);</span>
var xg = new XorGen(seed),
state = opts &amp;&amp; opts.state,
prng = function() { return (xg.next() &gt;&gt;&gt; 0) / 0x100000000; };
prng.double = function() {
do {
var top = xg.next() &gt;&gt;&gt; 11,
bot = (xg.next() &gt;&gt;&gt; 0) / 0x100000000,
result = (top + bot) / (1 &lt;&lt; 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;
}
&nbsp;
<span class="missing-if-branch" title="else path not taken" >E</span>if (module &amp;&amp; module.exports) {
module.exports = impl;
} else <span class="cstat-no" title="statement not covered" >if (define &amp;&amp; define.amd) {</span>
<span class="cstat-no" title="statement not covered" > define(<span class="fstat-no" title="function not covered" >fu</span>nction() { <span class="cstat-no" title="statement not covered" >return impl; </span>});</span>
} else {
<span class="cstat-no" title="statement not covered" > this.xorshift7 = impl;</span>
}
&nbsp;
})(
this,
(typeof module) == 'object' &amp;&amp; module, // present in node.js
(typeof define) == 'function' &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >define </span> // present with an AMD loader
);
&nbsp;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,327 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for seedrandom/lib/xorwow.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../../index.html">All files</a> / <a href="index.html">seedrandom/lib</a> xorwow.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">92.73% </span>
<span class="quiet">Statements</span>
<span class='fraction'>51/55</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">72.73% </span>
<span class="quiet">Branches</span>
<span class='fraction'>16/22</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">88.89% </span>
<span class="quiet">Functions</span>
<span class='fraction'>8/9</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">93.48% </span>
<span class="quiet">Lines</span>
<span class='fraction'>43/46</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">4105327x</span>
<span class="cline-any cline-yes">4105327x</span>
<span class="cline-any cline-yes">4105327x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">198x</span>
<span class="cline-any cline-yes">198x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">198x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">4102054x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// A Javascript implementaion of the "xorwow" prng algorithm by
// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper
&nbsp;
(function(global, module, define) {
&nbsp;
function XorGen(seed) {
var me = this, strseed = '';
&nbsp;
// Set up generator function.
me.next = function() {
var t = (me.x ^ (me.x &gt;&gt;&gt; 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 &lt;&lt; 4)) ^ (t ^ (t &lt;&lt; 1))) | 0;
};
&nbsp;
me.x = 0;
me.y = 0;
me.z = 0;
me.w = 0;
me.v = 0;
&nbsp;
if (seed === (seed | 0)) {
// Integer seed.
me.x = seed;
} else {
// String seed.
strseed += seed;
}
&nbsp;
// Mix in string seed, then discard an initial batch of 64 values.
for (var k = 0; k &lt; strseed.length + 64; k++) {
me.x ^= strseed.charCodeAt(k) | 0;
if (k == strseed.length) {
me.d = me.x &lt;&lt; 10 ^ me.x &gt;&gt;&gt; 4;
}
me.next();
}
}
&nbsp;
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;
}
&nbsp;
function impl(seed, opts) {
var xg = new XorGen(seed),
state = opts &amp;&amp; opts.state,
prng = function() { return (xg.next() &gt;&gt;&gt; 0) / 0x100000000; };
prng.double = function() {
do {
var top = xg.next() &gt;&gt;&gt; 11,
bot = (xg.next() &gt;&gt;&gt; 0) / 0x100000000,
result = (top + bot) / (1 &lt;&lt; 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;
}
&nbsp;
<span class="missing-if-branch" title="else path not taken" >E</span>if (module &amp;&amp; module.exports) {
module.exports = impl;
} else <span class="cstat-no" title="statement not covered" >if (define &amp;&amp; define.amd) {</span>
<span class="cstat-no" title="statement not covered" > define(<span class="fstat-no" title="function not covered" >fu</span>nction() { <span class="cstat-no" title="statement not covered" >return impl; </span>});</span>
} else {
<span class="cstat-no" title="statement not covered" > this.xorwow = impl;</span>
}
&nbsp;
})(
this,
(typeof module) == 'object' &amp;&amp; module, // present in node.js
(typeof define) == 'function' &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >define </span> // present with an AMD loader
);
&nbsp;
&nbsp;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,828 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for seedrandom/seedrandom.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../index.html">All files</a> / <a href="index.html">seedrandom</a> seedrandom.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">96% </span>
<span class="quiet">Statements</span>
<span class='fraction'>96/100</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">85.11% </span>
<span class="quiet">Branches</span>
<span class='fraction'>40/47</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">93.33% </span>
<span class="quiet">Functions</span>
<span class='fraction'>14/15</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">96.39% </span>
<span class="quiet">Lines</span>
<span class='fraction'>80/83</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</a>
<a name='L174'></a><a href='#L174'>174</a>
<a name='L175'></a><a href='#L175'>175</a>
<a name='L176'></a><a href='#L176'>176</a>
<a name='L177'></a><a href='#L177'>177</a>
<a name='L178'></a><a href='#L178'>178</a>
<a name='L179'></a><a href='#L179'>179</a>
<a name='L180'></a><a href='#L180'>180</a>
<a name='L181'></a><a href='#L181'>181</a>
<a name='L182'></a><a href='#L182'>182</a>
<a name='L183'></a><a href='#L183'>183</a>
<a name='L184'></a><a href='#L184'>184</a>
<a name='L185'></a><a href='#L185'>185</a>
<a name='L186'></a><a href='#L186'>186</a>
<a name='L187'></a><a href='#L187'>187</a>
<a name='L188'></a><a href='#L188'>188</a>
<a name='L189'></a><a href='#L189'>189</a>
<a name='L190'></a><a href='#L190'>190</a>
<a name='L191'></a><a href='#L191'>191</a>
<a name='L192'></a><a href='#L192'>192</a>
<a name='L193'></a><a href='#L193'>193</a>
<a name='L194'></a><a href='#L194'>194</a>
<a name='L195'></a><a href='#L195'>195</a>
<a name='L196'></a><a href='#L196'>196</a>
<a name='L197'></a><a href='#L197'>197</a>
<a name='L198'></a><a href='#L198'>198</a>
<a name='L199'></a><a href='#L199'>199</a>
<a name='L200'></a><a href='#L200'>200</a>
<a name='L201'></a><a href='#L201'>201</a>
<a name='L202'></a><a href='#L202'>202</a>
<a name='L203'></a><a href='#L203'>203</a>
<a name='L204'></a><a href='#L204'>204</a>
<a name='L205'></a><a href='#L205'>205</a>
<a name='L206'></a><a href='#L206'>206</a>
<a name='L207'></a><a href='#L207'>207</a>
<a name='L208'></a><a href='#L208'>208</a>
<a name='L209'></a><a href='#L209'>209</a>
<a name='L210'></a><a href='#L210'>210</a>
<a name='L211'></a><a href='#L211'>211</a>
<a name='L212'></a><a href='#L212'>212</a>
<a name='L213'></a><a href='#L213'>213</a>
<a name='L214'></a><a href='#L214'>214</a>
<a name='L215'></a><a href='#L215'>215</a>
<a name='L216'></a><a href='#L216'>216</a>
<a name='L217'></a><a href='#L217'>217</a>
<a name='L218'></a><a href='#L218'>218</a>
<a name='L219'></a><a href='#L219'>219</a>
<a name='L220'></a><a href='#L220'>220</a>
<a name='L221'></a><a href='#L221'>221</a>
<a name='L222'></a><a href='#L222'>222</a>
<a name='L223'></a><a href='#L223'>223</a>
<a name='L224'></a><a href='#L224'>224</a>
<a name='L225'></a><a href='#L225'>225</a>
<a name='L226'></a><a href='#L226'>226</a>
<a name='L227'></a><a href='#L227'>227</a>
<a name='L228'></a><a href='#L228'>228</a>
<a name='L229'></a><a href='#L229'>229</a>
<a name='L230'></a><a href='#L230'>230</a>
<a name='L231'></a><a href='#L231'>231</a>
<a name='L232'></a><a href='#L232'>232</a>
<a name='L233'></a><a href='#L233'>233</a>
<a name='L234'></a><a href='#L234'>234</a>
<a name='L235'></a><a href='#L235'>235</a>
<a name='L236'></a><a href='#L236'>236</a>
<a name='L237'></a><a href='#L237'>237</a>
<a name='L238'></a><a href='#L238'>238</a>
<a name='L239'></a><a href='#L239'>239</a>
<a name='L240'></a><a href='#L240'>240</a>
<a name='L241'></a><a href='#L241'>241</a>
<a name='L242'></a><a href='#L242'>242</a>
<a name='L243'></a><a href='#L243'>243</a>
<a name='L244'></a><a href='#L244'>244</a>
<a name='L245'></a><a href='#L245'>245</a>
<a name='L246'></a><a href='#L246'>246</a>
<a name='L247'></a><a href='#L247'>247</a>
<a name='L248'></a><a href='#L248'>248</a>
<a name='L249'></a><a href='#L249'>249</a>
<a name='L250'></a><a href='#L250'>250</a>
<a name='L251'></a><a href='#L251'>251</a>
<a name='L252'></a><a href='#L252'>252</a>
<a name='L253'></a><a href='#L253'>253</a>
<a name='L254'></a><a href='#L254'>254</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-yes">3694x</span>
<span class="cline-any cline-yes">3694x</span>
<span class="cline-any cline-yes">3694x</span>
<span class="cline-any cline-yes">3694x</span>
<span class="cline-any cline-yes">3917x</span>
<span class="cline-any cline-yes">3917x</span>
<span class="cline-any cline-yes">3917x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3694x</span>
<span class="cline-any cline-yes">9249x</span>
<span class="cline-any cline-yes">9249x</span>
<span class="cline-any cline-yes">9249x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3694x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1025x</span>
<span class="cline-any cline-yes">4100001x</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-yes">5888x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-yes">5888x</span>
<span class="cline-any cline-yes">5888x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4108660x</span>
<span class="cline-any cline-yes">4108660x</span>
<span class="cline-any cline-yes">4108660x</span>
<span class="cline-any cline-yes">16436073x</span>
<span class="cline-any cline-yes">16436073x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4108660x</span>
<span class="cline-any cline-yes">4108660x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">32x</span>
<span class="cline-any cline-yes">32x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">32x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">52x</span>
<span class="cline-any cline-yes">52x</span>
<span class="cline-any cline-yes">7735x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">52x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">81x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/*
Copyright 2019 David Bau.
&nbsp;
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:
&nbsp;
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
&nbsp;
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.
&nbsp;
*/
&nbsp;
(function (global, pool, math) {
//
// The following constants are related to IEEE 754 limits.
//
&nbsp;
var width = 256, // each RC4 output is 0 &lt;= x &lt; 256
chunks = 6, // at least six RC4 outputs for each double
digits = 52, // there are 52 significant digits in a double
rngname = 'random', // rngname: name for Math.random and Math.seedrandom
startdenom = math.pow(width, chunks),
significance = math.pow(2, digits),
overflow = significance * 2,
mask = width - 1,
nodecrypto; // node.js crypto module, initialized at the bottom.
&nbsp;
//
// seedrandom()
// This is the seedrandom function described above.
//
function seedrandom(seed, options, callback) {
var key = [];
options = (options == true) ? { entropy: true } : (options || {});
&nbsp;
// Flatten the seed string or build one from local entropy if needed.
var shortseed = mixkey(flatten(
options.entropy ? [seed, tostring(pool)] :
(seed == null) ? autoseed() : seed, 3), key);
&nbsp;
// Use the seed to initialize an ARC4 generator.
var arc4 = new ARC4(key);
&nbsp;
// This function returns a random double in [0, 1) that contains
// randomness in every bit of the mantissa of the IEEE 754 value.
var prng = function() {
var n = arc4.g(chunks), // Start with a numerator n &lt; 2 ^ 48
d = startdenom, // and denominator d = 2 ^ 48.
x = 0; // and no 'extra last byte'.
while (n &lt; significance) { // Fill up all significant digits by
n = (n + x) * width; // shifting numerator and
d *= width; // denominator and generating a
x = arc4.g(1); // new least-significant-byte.
}
while (n &gt;= overflow) { // To avoid rounding up, before adding
n /= 2; // last byte, shift everything
d /= 2; // right using integer math until
x &gt;&gt;&gt;= 1; // we have exactly the desired bits.
}
return (n + x) / d; // Form the number within [0, 1).
};
&nbsp;
prng.int32 = function() { return arc4.g(4) | 0; }
prng.quick = function() { return arc4.g(4) / 0x100000000; }
prng.double = prng;
&nbsp;
// Mix the randomness into accumulated entropy.
mixkey(tostring(arc4.S), pool);
&nbsp;
// Calling convention: what to return as a function of prng, seed, is_math.
return (options.pass || callback ||
function(prng, seed, is_math_call, state) {
if (state) {
// Load the arc4 state from the given state if it has an S array.
if (state.S) { copy(state, arc4); }
// Only provide the .state method if requested via options.state.
prng.state = function() { return copy(arc4, {}); }
}
&nbsp;
// If called as a method of Math (Math.seedrandom()), mutate
// Math.random because that is how seedrandom.js has worked since v1.0.
if (is_math_call) { math[rngname] = prng; return seed; }
&nbsp;
// Otherwise, it is a newer calling convention, so return the
// prng directly.
else return prng;
})(
prng,
shortseed,
'global' in options ? options.global : (this == math),
options.state);
}
&nbsp;
//
// ARC4
//
// An ARC4 implementation. The constructor takes a key in the form of
// an array of at most (width) integers that should be 0 &lt;= x &lt; (width).
//
// The g(count) method returns a pseudorandom integer that concatenates
// the next (count) outputs from ARC4. Its return value is a number x
// that is in the range 0 &lt;= x &lt; (width ^ count).
//
function ARC4(key) {
var t, keylen = key.length,
me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];
&nbsp;
// The empty key [] is treated as [0].
if (!keylen) { key = [keylen++]; }
&nbsp;
// Set up S using the standard key scheduling algorithm.
while (i &lt; width) {
s[i] = i++;
}
for (i = 0; i &lt; width; i++) {
s[i] = s[j = mask &amp; (j + key[i % keylen] + (t = s[i]))];
s[j] = t;
}
&nbsp;
// The "g" method returns the next (count) outputs as one number.
(me.g = function(count) {
// Using instance members instead of closure state nearly doubles speed.
var t, r = 0,
i = me.i, j = me.j, s = me.S;
while (count--) {
t = s[i = mask &amp; (i + 1)];
r = r * width + s[mask &amp; ((s[i] = s[j = mask &amp; (j + t)]) + (s[j] = t))];
}
me.i = i; me.j = j;
return r;
// For robust unpredictability, the function call below automatically
// discards an initial batch of values. This is called RC4-drop[256].
// See http://google.com/search?q=rsa+fluhrer+response&amp;btnI
})(width);
}
&nbsp;
//
// copy()
// Copies internal state of ARC4 to or from a plain object.
//
function copy(f, t) {
t.i = f.i;
t.j = f.j;
t.S = f.S.slice();
return t;
};
&nbsp;
//
// flatten()
// Converts an object tree to nested arrays of strings.
//
function flatten(obj, depth) {
var result = [], typ = (typeof obj), prop;
if (depth &amp;&amp; typ == 'object') {
for (prop in obj) {
try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}
}
}
return (result.length ? result : typ == 'string' ? obj : obj + '\0');
}
&nbsp;
//
// mixkey()
// Mixes a string seed into a key that is an array of integers, and
// returns a shortened string seed that is equivalent to the result key.
//
function mixkey(seed, key) {
var stringseed = seed + '', smear, j = 0;
while (j &lt; stringseed.length) {
key[mask &amp; j] =
mask &amp; ((smear ^= key[mask &amp; j] * 19) + stringseed.charCodeAt(j++));
}
return tostring(key);
}
&nbsp;
//
// autoseed()
// Returns an object for autoseeding, using window.crypto and Node crypto
// module if available.
//
function autoseed() {
try {
var out;
if (nodecrypto &amp;&amp; (out = nodecrypto.randomBytes)) {
// The use of 'out' to remember randomBytes makes tight minified code.
out = out(width);
} else {
out = new Uint8Array(width);
(global.crypto || global.msCrypto).getRandomValues(out);
}
return tostring(out);
} catch (e) {
var browser = global.navigator,
plugins = browser &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >browser.plugins;</span>
return [+new Date, global, plugins, global.screen, tostring(pool)];
}
}
&nbsp;
//
// tostring()
// Converts an array of charcodes to a string
//
function tostring(a) {
return String.fromCharCode.apply(0, a);
}
&nbsp;
//
// When seedrandom.js is loaded, we immediately mix a few bits
// from the built-in RNG into the entropy pool. Because we do
// not want to interfere with deterministic PRNG state later,
// seedrandom will not call math.random on its own again after
// initialization.
//
mixkey(math.random(), pool);
&nbsp;
//
// Nodejs and AMD support: export the implementation as a module using
// either convention.
//
<span class="missing-if-branch" title="else path not taken" >E</span>if ((typeof module) == 'object' &amp;&amp; module.exports) {
module.exports = seedrandom;
// When in node.js, try using crypto package for autoseeding.
try {
nodecrypto = require('crypto');
} catch (ex) {}
} else <span class="cstat-no" title="statement not covered" >if ((typeof define) == 'function' &amp;&amp; define.amd) {</span>
<span class="cstat-no" title="statement not covered" > define(<span class="fstat-no" title="function not covered" >fu</span>nction() { <span class="cstat-no" title="statement not covered" >return seedrandom; </span>});</span>
} else {
// When included as a plain script, set up Math.seedrandom global.
<span class="cstat-no" title="statement not covered" > math['seed' + rngname] = seedrandom;</span>
}
&nbsp;
&nbsp;
// End anonymous scope, and pass initial values.
})(
// global: `self` in browsers (including strict mode and web workers),
// otherwise `this` in Node and other environments
(typeof self !== 'undefined') ? <span class="branch-0 cbranch-no" title="branch not covered" >self </span>: this,
[], // pool: entropy pool starts empty
Math // math: package containing random, pow, and seedrandom
);
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Sep 17 2019 06:35:34 GMT-0400 (Eastern Daylight Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

170
node_modules/seedrandom/coverage/lcov-report/sorter.js generated vendored Normal file
View file

@ -0,0 +1,170 @@
/* eslint-disable */
var addSorting = (function() {
'use strict';
var cols,
currentSort = {
index: 0,
desc: false
};
// returns the summary table element
function getTable() {
return document.querySelector('.coverage-summary');
}
// returns the thead element of the summary table
function getTableHeader() {
return getTable().querySelector('thead tr');
}
// returns the tbody element of the summary table
function getTableBody() {
return getTable().querySelector('tbody');
}
// returns the th element for nth column
function getNthColumn(n) {
return getTableHeader().querySelectorAll('th')[n];
}
// loads all columns
function loadColumns() {
var colNodes = getTableHeader().querySelectorAll('th'),
colNode,
cols = [],
col,
i;
for (i = 0; i < colNodes.length; i += 1) {
colNode = colNodes[i];
col = {
key: colNode.getAttribute('data-col'),
sortable: !colNode.getAttribute('data-nosort'),
type: colNode.getAttribute('data-type') || 'string'
};
cols.push(col);
if (col.sortable) {
col.defaultDescSort = col.type === 'number';
colNode.innerHTML =
colNode.innerHTML + '<span class="sorter"></span>';
}
}
return cols;
}
// attaches a data attribute to every tr element with an object
// of data values keyed by column name
function loadRowData(tableRow) {
var tableCols = tableRow.querySelectorAll('td'),
colNode,
col,
data = {},
i,
val;
for (i = 0; i < tableCols.length; i += 1) {
colNode = tableCols[i];
col = cols[i];
val = colNode.getAttribute('data-value');
if (col.type === 'number') {
val = Number(val);
}
data[col.key] = val;
}
return data;
}
// loads all row data
function loadData() {
var rows = getTableBody().querySelectorAll('tr'),
i;
for (i = 0; i < rows.length; i += 1) {
rows[i].data = loadRowData(rows[i]);
}
}
// sorts the table using the data for the ith column
function sortByIndex(index, desc) {
var key = cols[index].key,
sorter = function(a, b) {
a = a.data[key];
b = b.data[key];
return a < b ? -1 : a > b ? 1 : 0;
},
finalSorter = sorter,
tableBody = document.querySelector('.coverage-summary tbody'),
rowNodes = tableBody.querySelectorAll('tr'),
rows = [],
i;
if (desc) {
finalSorter = function(a, b) {
return -1 * sorter(a, b);
};
}
for (i = 0; i < rowNodes.length; i += 1) {
rows.push(rowNodes[i]);
tableBody.removeChild(rowNodes[i]);
}
rows.sort(finalSorter);
for (i = 0; i < rows.length; i += 1) {
tableBody.appendChild(rows[i]);
}
}
// removes sort indicators for current column being sorted
function removeSortIndicators() {
var col = getNthColumn(currentSort.index),
cls = col.className;
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
col.className = cls;
}
// adds sort indicators for current column being sorted
function addSortIndicators() {
getNthColumn(currentSort.index).className += currentSort.desc
? ' sorted-desc'
: ' sorted';
}
// adds event listeners for all sorter widgets
function enableUI() {
var i,
el,
ithSorter = function ithSorter(i) {
var col = cols[i];
return function() {
var desc = col.defaultDescSort;
if (currentSort.index === i) {
desc = !currentSort.desc;
}
sortByIndex(i, desc);
removeSortIndicators();
currentSort.index = i;
currentSort.desc = desc;
addSortIndicators();
};
};
for (i = 0; i < cols.length; i += 1) {
if (cols[i].sortable) {
// add the click event handler on the th so users
// dont have to click on those tiny arrows
el = getNthColumn(i).querySelector('.sorter').parentElement;
if (el.addEventListener) {
el.addEventListener('click', ithSorter(i));
} else {
el.attachEvent('onclick', ithSorter(i));
}
}
}
}
// adds sorting functionality to the UI
return function() {
if (!getTable()) {
return;
}
cols = loadColumns();
loadData();
addSortIndicators();
enableUI();
};
})();
window.addEventListener('load', addSorting);

799
node_modules/seedrandom/coverage/lcov.info generated vendored Normal file
View file

@ -0,0 +1,799 @@
TN:
SF:/home/davidbau/git/seedrandom/seedrandom.js
FN:25,(anonymous_0)
FN:44,seedrandom
FN:58,(anonymous_2)
FN:75,(anonymous_3)
FN:76,(anonymous_4)
FN:84,(anonymous_5)
FN:89,(anonymous_6)
FN:116,ARC4
FN:133,(anonymous_8)
FN:153,copy
FN:164,flatten
FN:179,mixkey
FN:193,autoseed
FN:215,tostring
FN:239,(anonymous_14)
FNF:15
FNH:14
FNDA:6,(anonymous_0)
FNDA:23,seedrandom
FNDA:3694,(anonymous_2)
FNDA:1025,(anonymous_3)
FNDA:4100001,(anonymous_4)
FNDA:20,(anonymous_5)
FNDA:2,(anonymous_6)
FNDA:23,ARC4
FNDA:4108660,(anonymous_8)
FNDA:4,copy
FNDA:32,flatten
FNDA:52,mixkey
FNDA:4,autoseed
FNDA:81,tostring
FNDA:0,(anonymous_14)
DA:25,6
DA:30,6
DA:31,6
DA:32,6
DA:33,6
DA:34,6
DA:35,6
DA:36,6
DA:37,6
DA:45,23
DA:46,23
DA:49,23
DA:54,23
DA:58,23
DA:59,3694
DA:60,3694
DA:61,3694
DA:62,3694
DA:63,3917
DA:64,3917
DA:65,3917
DA:67,3694
DA:68,9249
DA:69,9249
DA:70,9249
DA:72,3694
DA:75,1025
DA:76,4100001
DA:77,23
DA:80,23
DA:83,23
DA:85,20
DA:87,4
DA:89,4
DA:94,20
DA:98,19
DA:117,23
DA:118,23
DA:121,23
DA:124,23
DA:125,5888
DA:127,23
DA:128,5888
DA:129,5888
DA:133,23
DA:135,4108660
DA:136,4108660
DA:137,4108660
DA:138,16436073
DA:139,16436073
DA:141,4108660
DA:142,4108660
DA:154,4
DA:155,4
DA:156,4
DA:157,4
DA:165,32
DA:166,32
DA:167,4
DA:168,9
DA:171,32
DA:180,52
DA:181,52
DA:182,7735
DA:185,52
DA:194,4
DA:196,4
DA:198,3
DA:200,1
DA:201,1
DA:203,3
DA:205,1
DA:206,1
DA:207,1
DA:216,81
DA:226,6
DA:232,6
DA:233,6
DA:235,6
DA:236,6
DA:238,0
DA:239,0
DA:242,0
LF:83
LH:80
BRDA:46,0,0,1
BRDA:46,0,1,22
BRDA:46,1,0,22
BRDA:46,1,1,11
BRDA:50,2,0,2
BRDA:50,2,1,21
BRDA:51,3,0,4
BRDA:51,3,1,17
BRDA:83,4,0,23
BRDA:83,4,1,21
BRDA:83,4,2,20
BRDA:85,5,0,4
BRDA:85,5,1,16
BRDA:87,6,0,2
BRDA:87,6,1,2
BRDA:94,7,0,1
BRDA:94,7,1,19
BRDA:102,8,0,4
BRDA:102,8,1,19
BRDA:121,9,0,1
BRDA:121,9,1,22
BRDA:166,10,0,4
BRDA:166,10,1,28
BRDA:166,11,0,32
BRDA:166,11,1,32
BRDA:171,12,0,3
BRDA:171,12,1,29
BRDA:171,13,0,23
BRDA:171,13,1,6
BRDA:196,14,0,3
BRDA:196,14,1,1
BRDA:196,15,0,4
BRDA:196,15,1,3
BRDA:201,16,0,1
BRDA:201,16,1,1
BRDA:206,17,0,1
BRDA:206,17,1,0
BRDA:232,18,0,6
BRDA:232,18,1,0
BRDA:232,19,0,6
BRDA:232,19,1,6
BRDA:238,20,0,0
BRDA:238,20,1,0
BRDA:238,21,0,0
BRDA:238,21,1,0
BRDA:250,22,0,0
BRDA:250,22,1,6
BRF:47
BRH:40
end_of_record
TN:
SF:/home/davidbau/git/seedrandom/lib/alea.js
FN:28,(anonymous_0)
FN:30,Alea
FN:33,(anonymous_2)
FN:54,copy
FN:62,impl
FN:66,(anonymous_5)
FN:67,(anonymous_6)
FN:73,(anonymous_7)
FN:78,Mash
FN:81,(anonymous_9)
FN:103,(anonymous_10)
FNF:11
FNH:10
FNDA:1,(anonymous_0)
FNDA:3,Alea
FNDA:4105129,(anonymous_2)
FNDA:2,copy
FNDA:3,impl
FNDA:1025,(anonymous_5)
FNDA:1025,(anonymous_6)
FNDA:1,(anonymous_7)
FNDA:3,Mash
FNDA:18,(anonymous_9)
FNDA:0,(anonymous_10)
DA:28,1
DA:31,3
DA:33,3
DA:34,4105129
DA:35,4105129
DA:36,4105129
DA:37,4105129
DA:41,3
DA:42,3
DA:43,3
DA:44,3
DA:45,3
DA:46,3
DA:47,3
DA:48,3
DA:49,3
DA:50,3
DA:51,3
DA:55,2
DA:56,2
DA:57,2
DA:58,2
DA:59,2
DA:63,3
DA:64,3
DA:65,3
DA:66,1025
DA:67,3
DA:68,1025
DA:70,3
DA:71,3
DA:72,2
DA:73,2
DA:75,3
DA:79,3
DA:81,3
DA:82,18
DA:83,18
DA:84,33
DA:85,33
DA:86,33
DA:87,33
DA:88,33
DA:89,33
DA:90,33
DA:91,33
DA:93,18
DA:96,3
DA:100,1
DA:101,1
DA:102,0
DA:103,0
DA:105,0
LF:53
LH:50
BRDA:46,0,0,1
BRDA:46,0,1,2
BRDA:48,1,0,3
BRDA:48,1,1,0
BRDA:50,2,0,0
BRDA:50,2,1,3
BRDA:64,3,0,3
BRDA:64,3,1,2
BRDA:71,4,0,2
BRDA:71,4,1,1
BRDA:72,5,0,1
BRDA:72,5,1,1
BRDA:100,6,0,1
BRDA:100,6,1,0
BRDA:100,7,0,1
BRDA:100,7,1,1
BRDA:102,8,0,0
BRDA:102,8,1,0
BRDA:102,9,0,0
BRDA:102,9,1,0
BRDA:110,10,0,1
BRDA:110,10,1,1
BRDA:111,11,0,1
BRDA:111,11,1,0
BRF:24
BRH:16
end_of_record
TN:
SF:/home/davidbau/git/seedrandom/lib/tychei.js
FN:5,(anonymous_0)
FN:7,XorGen
FN:11,(anonymous_2)
FN:60,copy
FN:68,impl
FN:71,(anonymous_5)
FN:72,(anonymous_6)
FN:84,(anonymous_7)
FN:92,(anonymous_8)
FNF:9
FNH:8
FNDA:1,(anonymous_0)
FNDA:3,XorGen
FNDA:4105195,(anonymous_2)
FNDA:2,copy
FNDA:3,impl
FNDA:4102054,(anonymous_5)
FNDA:1025,(anonymous_6)
FNDA:1,(anonymous_7)
FNDA:0,(anonymous_8)
DA:5,1
DA:8,3
DA:11,3
DA:12,4105195
DA:13,4105195
DA:14,4105195
DA:15,4105195
DA:16,4105195
DA:17,4105195
DA:18,4105195
DA:19,4105195
DA:20,4105195
DA:39,3
DA:40,3
DA:41,3
DA:42,3
DA:44,3
DA:46,2
DA:47,2
DA:50,1
DA:54,3
DA:55,66
DA:56,66
DA:61,2
DA:62,2
DA:63,2
DA:64,2
DA:65,2
DA:69,3
DA:70,3
DA:71,4102054
DA:72,3
DA:73,1025
DA:74,1025
DA:75,1025
DA:76,1025
DA:78,1025
DA:80,3
DA:81,3
DA:82,3
DA:83,2
DA:84,2
DA:86,3
DA:89,1
DA:90,1
DA:91,0
DA:92,0
DA:94,0
LF:48
LH:45
BRDA:44,0,0,2
BRDA:44,0,1,1
BRDA:70,1,0,3
BRDA:70,1,1,2
BRDA:82,2,0,2
BRDA:82,2,1,1
BRDA:83,3,0,1
BRDA:83,3,1,1
BRDA:89,4,0,1
BRDA:89,4,1,0
BRDA:89,5,0,1
BRDA:89,5,1,1
BRDA:91,6,0,0
BRDA:91,6,1,0
BRDA:91,7,0,0
BRDA:91,7,1,0
BRDA:99,8,0,1
BRDA:99,8,1,1
BRDA:100,9,0,1
BRDA:100,9,1,0
BRF:20
BRH:14
end_of_record
TN:
SF:/home/davidbau/git/seedrandom/lib/xor128.js
FN:4,(anonymous_0)
FN:6,XorGen
FN:15,(anonymous_2)
FN:38,copy
FN:46,impl
FN:49,(anonymous_5)
FN:50,(anonymous_6)
FN:62,(anonymous_7)
FN:70,(anonymous_8)
FNF:9
FNH:8
FNDA:1,(anonymous_0)
FNDA:3,XorGen
FNDA:4105327,(anonymous_2)
FNDA:2,copy
FNDA:3,impl
FNDA:4102054,(anonymous_5)
FNDA:1025,(anonymous_6)
FNDA:1,(anonymous_7)
FNDA:0,(anonymous_8)
DA:4,1
DA:7,3
DA:9,3
DA:10,3
DA:11,3
DA:12,3
DA:15,3
DA:16,4105327
DA:17,4105327
DA:18,4105327
DA:19,4105327
DA:20,4105327
DA:23,3
DA:25,2
DA:28,1
DA:32,3
DA:33,198
DA:34,198
DA:39,2
DA:40,2
DA:41,2
DA:42,2
DA:43,2
DA:47,3
DA:48,3
DA:49,4102054
DA:50,3
DA:51,1025
DA:52,1025
DA:53,1025
DA:54,1025
DA:56,1025
DA:58,3
DA:59,3
DA:60,3
DA:61,2
DA:62,2
DA:64,3
DA:67,1
DA:68,1
DA:69,0
DA:70,0
DA:72,0
LF:43
LH:40
BRDA:23,0,0,2
BRDA:23,0,1,1
BRDA:48,1,0,3
BRDA:48,1,1,2
BRDA:60,2,0,2
BRDA:60,2,1,1
BRDA:61,3,0,1
BRDA:61,3,1,1
BRDA:67,4,0,1
BRDA:67,4,1,0
BRDA:67,5,0,1
BRDA:67,5,1,1
BRDA:69,6,0,0
BRDA:69,6,1,0
BRDA:69,7,0,0
BRDA:69,7,1,0
BRDA:77,8,0,1
BRDA:77,8,1,1
BRDA:78,9,0,1
BRDA:78,9,1,0
BRF:20
BRH:14
end_of_record
TN:
SF:/home/davidbau/git/seedrandom/lib/xor4096.js
FN:26,(anonymous_0)
FN:28,XorGen
FN:32,(anonymous_2)
FN:51,init
FN:105,copy
FN:112,impl
FN:116,(anonymous_6)
FN:117,(anonymous_7)
FN:129,(anonymous_8)
FN:137,(anonymous_9)
FNF:10
FNH:9
FNDA:1,(anonymous_0)
FNDA:3,XorGen
FNDA:4105129,(anonymous_2)
FNDA:3,init
FNDA:2,copy
FNDA:3,impl
FNDA:4102054,(anonymous_6)
FNDA:1025,(anonymous_7)
FNDA:1,(anonymous_8)
FNDA:0,(anonymous_9)
DA:26,1
DA:29,3
DA:32,3
DA:33,4105129
DA:34,4105129
DA:36,4105129
DA:38,4105129
DA:39,4105129
DA:40,4105129
DA:41,4105129
DA:42,4105129
DA:43,4105129
DA:45,4105129
DA:46,4105129
DA:48,4105129
DA:52,3
DA:53,3
DA:55,2
DA:56,2
DA:59,1
DA:60,1
DA:61,1
DA:64,3
DA:66,480
DA:68,480
DA:69,480
DA:70,480
DA:71,480
DA:72,480
DA:73,480
DA:74,384
DA:75,384
DA:76,384
DA:80,3
DA:81,0
DA:86,3
DA:87,3
DA:88,1536
DA:89,1536
DA:90,1536
DA:91,1536
DA:92,1536
DA:93,1536
DA:94,1536
DA:97,3
DA:98,3
DA:99,3
DA:102,3
DA:106,2
DA:107,2
DA:108,2
DA:109,2
DA:113,3
DA:114,3
DA:115,3
DA:116,4102054
DA:117,3
DA:118,1025
DA:119,1025
DA:120,1025
DA:121,1025
DA:123,1025
DA:125,3
DA:126,3
DA:127,3
DA:128,2
DA:129,2
DA:131,3
DA:134,1
DA:135,1
DA:136,0
DA:137,0
DA:139,0
LF:73
LH:69
BRDA:53,0,0,2
BRDA:53,0,1,1
BRDA:66,1,0,160
BRDA:66,1,1,320
BRDA:68,2,0,3
BRDA:68,2,1,477
BRDA:73,3,0,384
BRDA:73,3,1,96
BRDA:76,4,0,0
BRDA:76,4,1,384
BRDA:80,5,0,0
BRDA:80,5,1,3
BRDA:81,6,0,0
BRDA:81,6,1,0
BRDA:81,6,2,0
BRDA:113,7,0,0
BRDA:113,7,1,3
BRDA:115,8,0,3
BRDA:115,8,1,2
BRDA:127,9,0,2
BRDA:127,9,1,1
BRDA:128,10,0,1
BRDA:128,10,1,1
BRDA:134,11,0,1
BRDA:134,11,1,0
BRDA:134,12,0,1
BRDA:134,12,1,1
BRDA:136,13,0,0
BRDA:136,13,1,0
BRDA:136,14,0,0
BRDA:136,14,1,0
BRDA:144,15,0,1
BRDA:144,15,1,1
BRDA:145,16,0,1
BRDA:145,16,1,0
BRF:35
BRH:23
end_of_record
TN:
SF:/home/davidbau/git/seedrandom/lib/xorshift7.js
FN:6,(anonymous_0)
FN:8,XorGen
FN:12,(anonymous_2)
FN:25,init
FN:56,copy
FN:62,impl
FN:66,(anonymous_6)
FN:67,(anonymous_7)
FN:79,(anonymous_8)
FN:87,(anonymous_9)
FNF:10
FNH:9
FNDA:1,(anonymous_0)
FNDA:3,XorGen
FNDA:4105897,(anonymous_2)
FNDA:3,init
FNDA:2,copy
FNDA:3,impl
FNDA:4102054,(anonymous_6)
FNDA:1025,(anonymous_7)
FNDA:1,(anonymous_8)
FNDA:0,(anonymous_9)
DA:6,1
DA:9,3
DA:12,3
DA:14,4105897
DA:15,4105897
DA:16,4105897
DA:17,4105897
DA:18,4105897
DA:19,4105897
DA:20,4105897
DA:21,4105897
DA:22,4105897
DA:26,3
DA:28,3
DA:30,2
DA:33,1
DA:34,1
DA:35,6
DA:40,16
DA:41,3
DA:42,3
DA:44,3
DA:45,3
DA:48,3
DA:49,768
DA:53,3
DA:57,2
DA:58,2
DA:59,2
DA:63,3
DA:64,3
DA:65,3
DA:66,4102054
DA:67,3
DA:68,1025
DA:69,1025
DA:70,1025
DA:71,1025
DA:73,1025
DA:75,3
DA:76,3
DA:77,3
DA:78,2
DA:79,2
DA:81,3
DA:84,1
DA:85,1
DA:86,0
DA:87,0
DA:89,0
LF:50
LH:47
BRDA:28,0,0,2
BRDA:28,0,1,1
BRDA:41,1,0,19
BRDA:41,1,1,17
BRDA:42,2,0,2
BRDA:42,2,1,1
BRDA:63,3,0,0
BRDA:63,3,1,3
BRDA:65,4,0,3
BRDA:65,4,1,2
BRDA:77,5,0,2
BRDA:77,5,1,1
BRDA:78,6,0,1
BRDA:78,6,1,1
BRDA:84,7,0,1
BRDA:84,7,1,0
BRDA:84,8,0,1
BRDA:84,8,1,1
BRDA:86,9,0,0
BRDA:86,9,1,0
BRDA:86,10,0,0
BRDA:86,10,1,0
BRDA:94,11,0,1
BRDA:94,11,1,1
BRDA:95,12,0,1
BRDA:95,12,1,0
BRF:26
BRH:19
end_of_record
TN:
SF:/home/davidbau/git/seedrandom/lib/xorwow.js
FN:4,(anonymous_0)
FN:6,XorGen
FN:10,(anonymous_2)
FN:41,copy
FN:51,impl
FN:54,(anonymous_5)
FN:55,(anonymous_6)
FN:67,(anonymous_7)
FN:75,(anonymous_8)
FNF:9
FNH:8
FNDA:1,(anonymous_0)
FNDA:3,XorGen
FNDA:4105327,(anonymous_2)
FNDA:2,copy
FNDA:3,impl
FNDA:4102054,(anonymous_5)
FNDA:1025,(anonymous_6)
FNDA:1,(anonymous_7)
FNDA:0,(anonymous_8)
DA:4,1
DA:7,3
DA:10,3
DA:11,4105327
DA:12,4105327
DA:13,4105327
DA:17,3
DA:18,3
DA:19,3
DA:20,3
DA:21,3
DA:23,3
DA:25,2
DA:28,1
DA:32,3
DA:33,198
DA:34,198
DA:35,3
DA:37,198
DA:42,2
DA:43,2
DA:44,2
DA:45,2
DA:46,2
DA:47,2
DA:48,2
DA:52,3
DA:53,3
DA:54,4102054
DA:55,3
DA:56,1025
DA:57,1025
DA:58,1025
DA:59,1025
DA:61,1025
DA:63,3
DA:64,3
DA:65,3
DA:66,2
DA:67,2
DA:69,3
DA:72,1
DA:73,1
DA:74,0
DA:75,0
DA:77,0
LF:46
LH:43
BRDA:23,0,0,2
BRDA:23,0,1,1
BRDA:34,1,0,3
BRDA:34,1,1,195
BRDA:53,2,0,3
BRDA:53,2,1,2
BRDA:65,3,0,2
BRDA:65,3,1,1
BRDA:66,4,0,1
BRDA:66,4,1,1
BRDA:72,5,0,1
BRDA:72,5,1,0
BRDA:72,6,0,1
BRDA:72,6,1,1
BRDA:74,7,0,0
BRDA:74,7,1,0
BRDA:74,8,0,0
BRDA:74,8,1,0
BRDA:82,9,0,1
BRDA:82,9,1,1
BRDA:83,10,0,1
BRDA:83,10,1,0
BRF:22
BRH:16
end_of_record

60
node_modules/seedrandom/index.js generated vendored Normal file
View file

@ -0,0 +1,60 @@
// A library of seedable RNGs implemented in Javascript.
//
// Usage:
//
// var seedrandom = require('seedrandom');
// var random = seedrandom(1); // or any seed.
// var x = random(); // 0 <= x < 1. Every bit is random.
// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.
// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.
// Period: ~2^116
// Reported to pass all BigCrush tests.
var alea = require('./lib/alea');
// xor128, a pure xor-shift generator by George Marsaglia.
// Period: 2^128-1.
// Reported to fail: MatrixRank and LinearComp.
var xor128 = require('./lib/xor128');
// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.
// Period: 2^192-2^32
// Reported to fail: CollisionOver, SimpPoker, and LinearComp.
var xorwow = require('./lib/xorwow');
// xorshift7, by François Panneton and Pierre L'ecuyer, takes
// a different approach: it adds robustness by allowing more shifts
// than Marsaglia's original three. It is a 7-shift generator
// with 256 bits, that passes BigCrush with no systmatic failures.
// Period 2^256-1.
// No systematic BigCrush failures reported.
var xorshift7 = require('./lib/xorshift7');
// xor4096, by Richard Brent, is a 4096-bit xor-shift with a
// very long period that also adds a Weyl generator. It also passes
// BigCrush with no systematic failures. Its long period may
// be useful if you have many generators and need to avoid
// collisions.
// Period: 2^4128-2^32.
// No systematic BigCrush failures reported.
var xor4096 = require('./lib/xor4096');
// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random
// number generator derived from ChaCha, a modern stream cipher.
// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf
// Period: ~2^127
// No systematic BigCrush failures reported.
var tychei = require('./lib/tychei');
// The original ARC4-based prng included in this library.
// Period: ~2^1600
var sr = require('./seedrandom');
sr.alea = alea;
sr.xor128 = xor128;
sr.xorwow = xorwow;
sr.xorshift7 = xorshift7;
sr.xor4096 = xor4096;
sr.tychei = tychei;
module.exports = sr;

114
node_modules/seedrandom/lib/alea.js generated vendored Normal file
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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);

60
node_modules/seedrandom/package.json generated vendored Normal file
View file

@ -0,0 +1,60 @@
{
"name": "seedrandom",
"version": "3.0.5",
"description": "Seeded random number generator for Javascript.",
"main": "index.js",
"jsdelivr": "seedrandom.min.js",
"unpkg": "seedrandom.min.js",
"keywords": [
"seed",
"random",
"crypto"
],
"scripts": {
"test": "grunt travis"
},
"repository": {
"type": "git",
"url": "git://github.com/davidbau/seedrandom.git"
},
"author": "David Bau",
"license": "MIT",
"bugs": {
"url": "https://github.com/davidbau/seedrandom/issues"
},
"homepage": "http://davidbau.com/archives/2010/01/30/random_seeds_coded_hints_and_quintillions.html",
"config": {
"blanket": {
"pattern": [
"seedrandom.js",
"lib/alea.js",
"lib/xor128.js",
"lib/xorwow.js",
"lib/xorshift7.js",
"lib/tychei.js",
"lib/xor4096.js"
]
}
},
"browser": {
"crypto": false
},
"devDependencies": {
"blanket": "latest",
"coveralls": "latest",
"grunt": "latest",
"grunt-browserify": "latest",
"grunt-release": "davidbau/grunt-release",
"grunt-cli": "latest",
"grunt-contrib-connect": "latest",
"grunt-contrib-copy": "latest",
"grunt-contrib-qunit": "latest",
"grunt-contrib-uglify": "latest",
"grunt-mocha-nyc": "latest",
"mocha": "latest",
"nyc": "latest",
"proxyquire": "latest",
"qunit": "latest",
"requirejs": "latest"
}
}

253
node_modules/seedrandom/seedrandom.js generated vendored Normal file
View file

@ -0,0 +1,253 @@
/*
Copyright 2019 David Bau.
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, pool, math) {
//
// The following constants are related to IEEE 754 limits.
//
var width = 256, // each RC4 output is 0 <= x < 256
chunks = 6, // at least six RC4 outputs for each double
digits = 52, // there are 52 significant digits in a double
rngname = 'random', // rngname: name for Math.random and Math.seedrandom
startdenom = math.pow(width, chunks),
significance = math.pow(2, digits),
overflow = significance * 2,
mask = width - 1,
nodecrypto; // node.js crypto module, initialized at the bottom.
//
// seedrandom()
// This is the seedrandom function described above.
//
function seedrandom(seed, options, callback) {
var key = [];
options = (options == true) ? { entropy: true } : (options || {});
// Flatten the seed string or build one from local entropy if needed.
var shortseed = mixkey(flatten(
options.entropy ? [seed, tostring(pool)] :
(seed == null) ? autoseed() : seed, 3), key);
// Use the seed to initialize an ARC4 generator.
var arc4 = new ARC4(key);
// This function returns a random double in [0, 1) that contains
// randomness in every bit of the mantissa of the IEEE 754 value.
var prng = function() {
var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48
d = startdenom, // and denominator d = 2 ^ 48.
x = 0; // and no 'extra last byte'.
while (n < significance) { // Fill up all significant digits by
n = (n + x) * width; // shifting numerator and
d *= width; // denominator and generating a
x = arc4.g(1); // new least-significant-byte.
}
while (n >= overflow) { // To avoid rounding up, before adding
n /= 2; // last byte, shift everything
d /= 2; // right using integer math until
x >>>= 1; // we have exactly the desired bits.
}
return (n + x) / d; // Form the number within [0, 1).
};
prng.int32 = function() { return arc4.g(4) | 0; }
prng.quick = function() { return arc4.g(4) / 0x100000000; }
prng.double = prng;
// Mix the randomness into accumulated entropy.
mixkey(tostring(arc4.S), pool);
// Calling convention: what to return as a function of prng, seed, is_math.
return (options.pass || callback ||
function(prng, seed, is_math_call, state) {
if (state) {
// Load the arc4 state from the given state if it has an S array.
if (state.S) { copy(state, arc4); }
// Only provide the .state method if requested via options.state.
prng.state = function() { return copy(arc4, {}); }
}
// If called as a method of Math (Math.seedrandom()), mutate
// Math.random because that is how seedrandom.js has worked since v1.0.
if (is_math_call) { math[rngname] = prng; return seed; }
// Otherwise, it is a newer calling convention, so return the
// prng directly.
else return prng;
})(
prng,
shortseed,
'global' in options ? options.global : (this == math),
options.state);
}
//
// ARC4
//
// An ARC4 implementation. The constructor takes a key in the form of
// an array of at most (width) integers that should be 0 <= x < (width).
//
// The g(count) method returns a pseudorandom integer that concatenates
// the next (count) outputs from ARC4. Its return value is a number x
// that is in the range 0 <= x < (width ^ count).
//
function ARC4(key) {
var t, keylen = key.length,
me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];
// The empty key [] is treated as [0].
if (!keylen) { key = [keylen++]; }
// Set up S using the standard key scheduling algorithm.
while (i < width) {
s[i] = i++;
}
for (i = 0; i < width; i++) {
s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];
s[j] = t;
}
// The "g" method returns the next (count) outputs as one number.
(me.g = function(count) {
// Using instance members instead of closure state nearly doubles speed.
var t, r = 0,
i = me.i, j = me.j, s = me.S;
while (count--) {
t = s[i = mask & (i + 1)];
r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];
}
me.i = i; me.j = j;
return r;
// For robust unpredictability, the function call below automatically
// discards an initial batch of values. This is called RC4-drop[256].
// See http://google.com/search?q=rsa+fluhrer+response&btnI
})(width);
}
//
// copy()
// Copies internal state of ARC4 to or from a plain object.
//
function copy(f, t) {
t.i = f.i;
t.j = f.j;
t.S = f.S.slice();
return t;
};
//
// flatten()
// Converts an object tree to nested arrays of strings.
//
function flatten(obj, depth) {
var result = [], typ = (typeof obj), prop;
if (depth && typ == 'object') {
for (prop in obj) {
try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}
}
}
return (result.length ? result : typ == 'string' ? obj : obj + '\0');
}
//
// mixkey()
// Mixes a string seed into a key that is an array of integers, and
// returns a shortened string seed that is equivalent to the result key.
//
function mixkey(seed, key) {
var stringseed = seed + '', smear, j = 0;
while (j < stringseed.length) {
key[mask & j] =
mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));
}
return tostring(key);
}
//
// autoseed()
// Returns an object for autoseeding, using window.crypto and Node crypto
// module if available.
//
function autoseed() {
try {
var out;
if (nodecrypto && (out = nodecrypto.randomBytes)) {
// The use of 'out' to remember randomBytes makes tight minified code.
out = out(width);
} else {
out = new Uint8Array(width);
(global.crypto || global.msCrypto).getRandomValues(out);
}
return tostring(out);
} catch (e) {
var browser = global.navigator,
plugins = browser && browser.plugins;
return [+new Date, global, plugins, global.screen, tostring(pool)];
}
}
//
// tostring()
// Converts an array of charcodes to a string
//
function tostring(a) {
return String.fromCharCode.apply(0, a);
}
//
// When seedrandom.js is loaded, we immediately mix a few bits
// from the built-in RNG into the entropy pool. Because we do
// not want to interfere with deterministic PRNG state later,
// seedrandom will not call math.random on its own again after
// initialization.
//
mixkey(math.random(), pool);
//
// Nodejs and AMD support: export the implementation as a module using
// either convention.
//
if ((typeof module) == 'object' && module.exports) {
module.exports = seedrandom;
// When in node.js, try using crypto package for autoseeding.
try {
nodecrypto = require('crypto');
} catch (ex) {}
} else if ((typeof define) == 'function' && define.amd) {
define(function() { return seedrandom; });
} else {
// When included as a plain script, set up Math.seedrandom global.
math['seed' + rngname] = seedrandom;
}
// End anonymous scope, and pass initial values.
})(
// global: `self` in browsers (including strict mode and web workers),
// otherwise `this` in Node and other environments
(typeof self !== 'undefined') ? self : this,
[], // pool: entropy pool starts empty
Math // math: package containing random, pow, and seedrandom
);

1
node_modules/seedrandom/seedrandom.min.js generated vendored Normal file
View file

@ -0,0 +1 @@
!function(f,a,c){var s,l=256,p="random",d=c.pow(l,6),g=c.pow(2,52),y=2*g,h=l-1;function n(n,t,r){function e(){for(var n=u.g(6),t=d,r=0;n<g;)n=(n+r)*l,t*=l,r=u.g(1);for(;y<=n;)n/=2,t/=2,r>>>=1;return(n+r)/t}var o=[],i=j(function n(t,r){var e,o=[],i=typeof t;if(r&&"object"==i)for(e in t)try{o.push(n(t[e],r-1))}catch(n){}return o.length?o:"string"==i?t:t+"\0"}((t=1==t?{entropy:!0}:t||{}).entropy?[n,S(a)]:null==n?function(){try{var n;return s&&(n=s.randomBytes)?n=n(l):(n=new Uint8Array(l),(f.crypto||f.msCrypto).getRandomValues(n)),S(n)}catch(n){var t=f.navigator,r=t&&t.plugins;return[+new Date,f,r,f.screen,S(a)]}}():n,3),o),u=new m(o);return e.int32=function(){return 0|u.g(4)},e.quick=function(){return u.g(4)/4294967296},e.double=e,j(S(u.S),a),(t.pass||r||function(n,t,r,e){return e&&(e.S&&v(e,u),n.state=function(){return v(u,{})}),r?(c[p]=n,t):n})(e,i,"global"in t?t.global:this==c,t.state)}function m(n){var t,r=n.length,u=this,e=0,o=u.i=u.j=0,i=u.S=[];for(r||(n=[r++]);e<l;)i[e]=e++;for(e=0;e<l;e++)i[e]=i[o=h&o+n[e%r]+(t=i[e])],i[o]=t;(u.g=function(n){for(var t,r=0,e=u.i,o=u.j,i=u.S;n--;)t=i[e=h&e+1],r=r*l+i[h&(i[e]=i[o=h&o+t])+(i[o]=t)];return u.i=e,u.j=o,r})(l)}function v(n,t){return t.i=n.i,t.j=n.j,t.S=n.S.slice(),t}function j(n,t){for(var r,e=n+"",o=0;o<e.length;)t[h&o]=h&(r^=19*t[h&o])+e.charCodeAt(o++);return S(t)}function S(n){return String.fromCharCode.apply(0,n)}if(j(c.random(),a),"object"==typeof module&&module.exports){module.exports=n;try{s=require("crypto")}catch(n){}}else"function"==typeof define&&define.amd?define(function(){return n}):c["seed"+p]=n}("undefined"!=typeof self?self:this,[],Math);

55
node_modules/typescript/LICENSE.txt generated vendored Normal file
View file

@ -0,0 +1,55 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
You must give any other recipients of the Work or Derivative Works a copy of this License; and
You must cause any modified files to carry prominent notices stating that You changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

49
node_modules/typescript/README.md generated vendored Normal file
View file

@ -0,0 +1,49 @@
# TypeScript
[![GitHub Actions CI](https://github.com/microsoft/TypeScript/workflows/CI/badge.svg)](https://github.com/microsoft/TypeScript/actions?query=workflow%3ACI)
[![Devops Build Status](https://dev.azure.com/typescript/TypeScript/_apis/build/status/Typescript/node10)](https://dev.azure.com/typescript/TypeScript/_build?definitionId=7)
[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)
[TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescript).
Find others who are using TypeScript at [our community page](https://www.typescriptlang.org/community/).
## Installing
For the latest stable version:
```bash
npm install -g typescript
```
For our nightly builds:
```bash
npm install -g typescript@next
```
## Contribute
There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md) to TypeScript.
* [Submit bugs](https://github.com/microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
* Review the [source code changes](https://github.com/microsoft/TypeScript/pulls).
* Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript).
* Help each other in the [TypeScript Community Discord](https://discord.gg/typescript).
* Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter.
* [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md).
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see
the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com)
with any additional questions or comments.
## Documentation
* [TypeScript in 5 minutes](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html)
* [Programming handbook](https://www.typescriptlang.org/docs/handbook/intro.html)
* [Homepage](https://www.typescriptlang.org/)
## Roadmap
For details on our planned features and future direction please refer to our [roadmap](https://github.com/microsoft/TypeScript/wiki/Roadmap).

41
node_modules/typescript/SECURITY.md generated vendored Normal file
View file

@ -0,0 +1,41 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
## Security
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
## Reporting Security Issues
**Please do not report security vulnerabilities through public GitHub issues.**
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
This information will help us triage your report more quickly.
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
## Preferred Languages
We prefer all communications to be in English.
## Policy
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
<!-- END MICROSOFT SECURITY.MD BLOCK -->

193
node_modules/typescript/ThirdPartyNoticeText.txt generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/typescript/bin/tsc generated vendored Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env node
require('../lib/tsc.js')

2
node_modules/typescript/bin/tsserver generated vendored Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env node
require('../lib/tsserver.js')

5
node_modules/typescript/lib/README.md generated vendored Normal file
View file

@ -0,0 +1,5 @@
# Read This!
**These files are not meant to be edited by hand.**
If you need to make modifications, the respective files should be changed within the repository's top-level `src` directory.
Running `hereby LKG` will then appropriately update the files in this directory.

91
node_modules/typescript/lib/cancellationToken.js generated vendored Normal file
View file

@ -0,0 +1,91 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// src/cancellationToken/cancellationToken.ts
var fs = __toESM(require("fs"));
function pipeExists(name) {
return fs.existsSync(name);
}
function createCancellationToken(args) {
let cancellationPipeName;
for (let i = 0; i < args.length - 1; i++) {
if (args[i] === "--cancellationPipeName") {
cancellationPipeName = args[i + 1];
break;
}
}
if (!cancellationPipeName) {
return {
isCancellationRequested: () => false,
setRequest: (_requestId) => void 0,
resetRequest: (_requestId) => void 0
};
}
if (cancellationPipeName.charAt(cancellationPipeName.length - 1) === "*") {
const namePrefix = cancellationPipeName.slice(0, -1);
if (namePrefix.length === 0 || namePrefix.indexOf("*") >= 0) {
throw new Error("Invalid name for template cancellation pipe: it should have length greater than 2 characters and contain only one '*'.");
}
let perRequestPipeName;
let currentRequestId;
return {
isCancellationRequested: () => perRequestPipeName !== void 0 && pipeExists(perRequestPipeName),
setRequest(requestId) {
currentRequestId = requestId;
perRequestPipeName = namePrefix + requestId;
},
resetRequest(requestId) {
if (currentRequestId !== requestId) {
throw new Error(`Mismatched request id, expected ${currentRequestId}, actual ${requestId}`);
}
perRequestPipeName = void 0;
}
};
} else {
return {
isCancellationRequested: () => pipeExists(cancellationPipeName),
// TODO: GH#18217
setRequest: (_requestId) => void 0,
resetRequest: (_requestId) => void 0
};
}
}
module.exports = createCancellationToken;
//# sourceMappingURL=cancellationToken.js.map

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more