mirror of
https://github.com/xfarrow/blink
synced 2025-06-27 09:03:02 +02:00
Change endpoint from persons to people
This commit is contained in:
1
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/Distribution.js
generated
vendored
Normal file
1
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/Distribution.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
12
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/UniformArrayIntDistribution.js
generated
vendored
Normal file
12
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/UniformArrayIntDistribution.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import { unsafeUniformArrayIntDistribution } from './UnsafeUniformArrayIntDistribution.js';
|
||||
function uniformArrayIntDistribution(from, to, rng) {
|
||||
if (rng != null) {
|
||||
var nextRng = rng.clone();
|
||||
return [unsafeUniformArrayIntDistribution(from, to, nextRng), nextRng];
|
||||
}
|
||||
return function (rng) {
|
||||
var nextRng = rng.clone();
|
||||
return [unsafeUniformArrayIntDistribution(from, to, nextRng), nextRng];
|
||||
};
|
||||
}
|
||||
export { uniformArrayIntDistribution };
|
12
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/UniformBigIntDistribution.js
generated
vendored
Normal file
12
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/UniformBigIntDistribution.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import { unsafeUniformBigIntDistribution } from './UnsafeUniformBigIntDistribution.js';
|
||||
function uniformBigIntDistribution(from, to, rng) {
|
||||
if (rng != null) {
|
||||
var nextRng = rng.clone();
|
||||
return [unsafeUniformBigIntDistribution(from, to, nextRng), nextRng];
|
||||
}
|
||||
return function (rng) {
|
||||
var nextRng = rng.clone();
|
||||
return [unsafeUniformBigIntDistribution(from, to, nextRng), nextRng];
|
||||
};
|
||||
}
|
||||
export { uniformBigIntDistribution };
|
12
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/UniformIntDistribution.js
generated
vendored
Normal file
12
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/UniformIntDistribution.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import { unsafeUniformIntDistribution } from './UnsafeUniformIntDistribution.js';
|
||||
function uniformIntDistribution(from, to, rng) {
|
||||
if (rng != null) {
|
||||
var nextRng = rng.clone();
|
||||
return [unsafeUniformIntDistribution(from, to, nextRng), nextRng];
|
||||
}
|
||||
return function (rng) {
|
||||
var nextRng = rng.clone();
|
||||
return [unsafeUniformIntDistribution(from, to, nextRng), nextRng];
|
||||
};
|
||||
}
|
||||
export { uniformIntDistribution };
|
8
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformArrayIntDistribution.js
generated
vendored
Normal file
8
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformArrayIntDistribution.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import { addArrayIntToNew, addOneToPositiveArrayInt, substractArrayIntToNew, trimArrayIntInplace, } from './internals/ArrayInt.js';
|
||||
import { unsafeUniformArrayIntDistributionInternal } from './internals/UnsafeUniformArrayIntDistributionInternal.js';
|
||||
export function unsafeUniformArrayIntDistribution(from, to, rng) {
|
||||
var rangeSize = trimArrayIntInplace(addOneToPositiveArrayInt(substractArrayIntToNew(to, from)));
|
||||
var emptyArrayIntData = rangeSize.data.slice(0);
|
||||
var g = unsafeUniformArrayIntDistributionInternal(emptyArrayIntData, rangeSize.data, rng);
|
||||
return trimArrayIntInplace(addArrayIntToNew({ sign: 1, data: g }, from));
|
||||
}
|
24
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformBigIntDistribution.js
generated
vendored
Normal file
24
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformBigIntDistribution.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
var SBigInt = typeof BigInt !== 'undefined' ? BigInt : undefined;
|
||||
export function unsafeUniformBigIntDistribution(from, to, rng) {
|
||||
var diff = to - from + SBigInt(1);
|
||||
var MinRng = SBigInt(-0x80000000);
|
||||
var NumValues = SBigInt(0x100000000);
|
||||
var FinalNumValues = NumValues;
|
||||
var NumIterations = 1;
|
||||
while (FinalNumValues < diff) {
|
||||
FinalNumValues *= NumValues;
|
||||
++NumIterations;
|
||||
}
|
||||
var MaxAcceptedRandom = FinalNumValues - (FinalNumValues % diff);
|
||||
while (true) {
|
||||
var value = SBigInt(0);
|
||||
for (var num = 0; num !== NumIterations; ++num) {
|
||||
var out = rng.unsafeNext();
|
||||
value = NumValues * value + (SBigInt(out) - MinRng);
|
||||
}
|
||||
if (value < MaxAcceptedRandom) {
|
||||
var inDiff = value % diff;
|
||||
return inDiff + from;
|
||||
}
|
||||
}
|
||||
}
|
30
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformIntDistribution.js
generated
vendored
Normal file
30
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformIntDistribution.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
import { unsafeUniformIntDistributionInternal } from './internals/UnsafeUniformIntDistributionInternal.js';
|
||||
import { fromNumberToArrayInt64, substractArrayInt64 } from './internals/ArrayInt.js';
|
||||
import { unsafeUniformArrayIntDistributionInternal } from './internals/UnsafeUniformArrayIntDistributionInternal.js';
|
||||
var safeNumberMaxSafeInteger = Number.MAX_SAFE_INTEGER;
|
||||
var sharedA = { sign: 1, data: [0, 0] };
|
||||
var sharedB = { sign: 1, data: [0, 0] };
|
||||
var sharedC = { sign: 1, data: [0, 0] };
|
||||
var sharedData = [0, 0];
|
||||
function uniformLargeIntInternal(from, to, rangeSize, rng) {
|
||||
var rangeSizeArrayIntValue = rangeSize <= safeNumberMaxSafeInteger
|
||||
? fromNumberToArrayInt64(sharedC, rangeSize)
|
||||
: substractArrayInt64(sharedC, fromNumberToArrayInt64(sharedA, to), fromNumberToArrayInt64(sharedB, from));
|
||||
if (rangeSizeArrayIntValue.data[1] === 0xffffffff) {
|
||||
rangeSizeArrayIntValue.data[0] += 1;
|
||||
rangeSizeArrayIntValue.data[1] = 0;
|
||||
}
|
||||
else {
|
||||
rangeSizeArrayIntValue.data[1] += 1;
|
||||
}
|
||||
unsafeUniformArrayIntDistributionInternal(sharedData, rangeSizeArrayIntValue.data, rng);
|
||||
return sharedData[0] * 0x100000000 + sharedData[1] + from;
|
||||
}
|
||||
export function unsafeUniformIntDistribution(from, to, rng) {
|
||||
var rangeSize = to - from;
|
||||
if (rangeSize <= 0xffffffff) {
|
||||
var g = unsafeUniformIntDistributionInternal(rangeSize + 1, rng);
|
||||
return g + from;
|
||||
}
|
||||
return uniformLargeIntInternal(from, to, rangeSize, rng);
|
||||
}
|
132
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt.js
generated
vendored
Normal file
132
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt.js
generated
vendored
Normal file
@ -0,0 +1,132 @@
|
||||
export function addArrayIntToNew(arrayIntA, arrayIntB) {
|
||||
if (arrayIntA.sign !== arrayIntB.sign) {
|
||||
return substractArrayIntToNew(arrayIntA, { sign: -arrayIntB.sign, data: arrayIntB.data });
|
||||
}
|
||||
var data = [];
|
||||
var reminder = 0;
|
||||
var dataA = arrayIntA.data;
|
||||
var dataB = arrayIntB.data;
|
||||
for (var indexA = dataA.length - 1, indexB = dataB.length - 1; indexA >= 0 || indexB >= 0; --indexA, --indexB) {
|
||||
var vA = indexA >= 0 ? dataA[indexA] : 0;
|
||||
var vB = indexB >= 0 ? dataB[indexB] : 0;
|
||||
var current = vA + vB + reminder;
|
||||
data.push(current >>> 0);
|
||||
reminder = ~~(current / 0x100000000);
|
||||
}
|
||||
if (reminder !== 0) {
|
||||
data.push(reminder);
|
||||
}
|
||||
return { sign: arrayIntA.sign, data: data.reverse() };
|
||||
}
|
||||
export function addOneToPositiveArrayInt(arrayInt) {
|
||||
arrayInt.sign = 1;
|
||||
var data = arrayInt.data;
|
||||
for (var index = data.length - 1; index >= 0; --index) {
|
||||
if (data[index] === 0xffffffff) {
|
||||
data[index] = 0;
|
||||
}
|
||||
else {
|
||||
data[index] += 1;
|
||||
return arrayInt;
|
||||
}
|
||||
}
|
||||
data.unshift(1);
|
||||
return arrayInt;
|
||||
}
|
||||
function isStrictlySmaller(dataA, dataB) {
|
||||
var maxLength = Math.max(dataA.length, dataB.length);
|
||||
for (var index = 0; index < maxLength; ++index) {
|
||||
var indexA = index + dataA.length - maxLength;
|
||||
var indexB = index + dataB.length - maxLength;
|
||||
var vA = indexA >= 0 ? dataA[indexA] : 0;
|
||||
var vB = indexB >= 0 ? dataB[indexB] : 0;
|
||||
if (vA < vB)
|
||||
return true;
|
||||
if (vA > vB)
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
export function substractArrayIntToNew(arrayIntA, arrayIntB) {
|
||||
if (arrayIntA.sign !== arrayIntB.sign) {
|
||||
return addArrayIntToNew(arrayIntA, { sign: -arrayIntB.sign, data: arrayIntB.data });
|
||||
}
|
||||
var dataA = arrayIntA.data;
|
||||
var dataB = arrayIntB.data;
|
||||
if (isStrictlySmaller(dataA, dataB)) {
|
||||
var out = substractArrayIntToNew(arrayIntB, arrayIntA);
|
||||
out.sign = -out.sign;
|
||||
return out;
|
||||
}
|
||||
var data = [];
|
||||
var reminder = 0;
|
||||
for (var indexA = dataA.length - 1, indexB = dataB.length - 1; indexA >= 0 || indexB >= 0; --indexA, --indexB) {
|
||||
var vA = indexA >= 0 ? dataA[indexA] : 0;
|
||||
var vB = indexB >= 0 ? dataB[indexB] : 0;
|
||||
var current = vA - vB - reminder;
|
||||
data.push(current >>> 0);
|
||||
reminder = current < 0 ? 1 : 0;
|
||||
}
|
||||
return { sign: arrayIntA.sign, data: data.reverse() };
|
||||
}
|
||||
export function trimArrayIntInplace(arrayInt) {
|
||||
var data = arrayInt.data;
|
||||
var firstNonZero = 0;
|
||||
for (; firstNonZero !== data.length && data[firstNonZero] === 0; ++firstNonZero) { }
|
||||
if (firstNonZero === data.length) {
|
||||
arrayInt.sign = 1;
|
||||
arrayInt.data = [0];
|
||||
return arrayInt;
|
||||
}
|
||||
data.splice(0, firstNonZero);
|
||||
return arrayInt;
|
||||
}
|
||||
export function fromNumberToArrayInt64(out, n) {
|
||||
if (n < 0) {
|
||||
var posN = -n;
|
||||
out.sign = -1;
|
||||
out.data[0] = ~~(posN / 0x100000000);
|
||||
out.data[1] = posN >>> 0;
|
||||
}
|
||||
else {
|
||||
out.sign = 1;
|
||||
out.data[0] = ~~(n / 0x100000000);
|
||||
out.data[1] = n >>> 0;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
export function substractArrayInt64(out, arrayIntA, arrayIntB) {
|
||||
var lowA = arrayIntA.data[1];
|
||||
var highA = arrayIntA.data[0];
|
||||
var signA = arrayIntA.sign;
|
||||
var lowB = arrayIntB.data[1];
|
||||
var highB = arrayIntB.data[0];
|
||||
var signB = arrayIntB.sign;
|
||||
out.sign = 1;
|
||||
if (signA === 1 && signB === -1) {
|
||||
var low_1 = lowA + lowB;
|
||||
var high = highA + highB + (low_1 > 0xffffffff ? 1 : 0);
|
||||
out.data[0] = high >>> 0;
|
||||
out.data[1] = low_1 >>> 0;
|
||||
return out;
|
||||
}
|
||||
var lowFirst = lowA;
|
||||
var highFirst = highA;
|
||||
var lowSecond = lowB;
|
||||
var highSecond = highB;
|
||||
if (signA === -1) {
|
||||
lowFirst = lowB;
|
||||
highFirst = highB;
|
||||
lowSecond = lowA;
|
||||
highSecond = highA;
|
||||
}
|
||||
var reminderLow = 0;
|
||||
var low = lowFirst - lowSecond;
|
||||
if (low < 0) {
|
||||
reminderLow = 1;
|
||||
low = low >>> 0;
|
||||
}
|
||||
out.data[0] = highFirst - highSecond - reminderLow;
|
||||
out.data[1] = low;
|
||||
return out;
|
||||
}
|
21
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformArrayIntDistributionInternal.js
generated
vendored
Normal file
21
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformArrayIntDistributionInternal.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
import { unsafeUniformIntDistributionInternal } from './UnsafeUniformIntDistributionInternal.js';
|
||||
export function unsafeUniformArrayIntDistributionInternal(out, rangeSize, rng) {
|
||||
var rangeLength = rangeSize.length;
|
||||
while (true) {
|
||||
for (var index = 0; index !== rangeLength; ++index) {
|
||||
var indexRangeSize = index === 0 ? rangeSize[0] + 1 : 0x100000000;
|
||||
var g = unsafeUniformIntDistributionInternal(indexRangeSize, rng);
|
||||
out[index] = g;
|
||||
}
|
||||
for (var index = 0; index !== rangeLength; ++index) {
|
||||
var current = out[index];
|
||||
var currentInRange = rangeSize[index];
|
||||
if (current < currentInRange) {
|
||||
return out;
|
||||
}
|
||||
else if (current > currentInRange) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
8
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformIntDistributionInternal.js
generated
vendored
Normal file
8
backend/apis/nodejs/node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformIntDistributionInternal.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
export function unsafeUniformIntDistributionInternal(rangeSize, rng) {
|
||||
var MaxAllowed = rangeSize > 2 ? ~~(0x100000000 / rangeSize) * rangeSize : 0x100000000;
|
||||
var deltaV = rng.unsafeNext() + 0x80000000;
|
||||
while (deltaV >= MaxAllowed) {
|
||||
deltaV = rng.unsafeNext() + 0x80000000;
|
||||
}
|
||||
return deltaV % rangeSize;
|
||||
}
|
Reference in New Issue
Block a user