Merge pull request #1182 from Mikunj/byte-buffer

Add ByteBuffer as a node module.
pull/1186/head
Mikunj Varsani 5 years ago committed by GitHub
commit 446dbd9549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -42,10 +42,10 @@ module.exports = grunt => {
},
util_worker: {
src: [
'components/bytebuffer/dist/ByteBufferAB.js',
'node_modules/bytebuffer/dist/bytebuffer.js',
'components/JSBI/dist/jsbi.mjs',
'libloki/proof-of-work.js',
'components/long/dist/Long.js',
'node_modules/long/dist/long.js',
'js/util_worker_tasks.js',
],
dest: 'js/util_worker.js',
@ -160,10 +160,10 @@ module.exports = grunt => {
},
utilworker: {
files: [
'components/bytebuffer/dist/ByteBufferAB.js',
'node_modules/bytebuffer/dist/bytebuffer.js',
'components/JSBI/dist/jsbi.mjs',
'libloki/proof-of-work.js',
'components/long/dist/Long.js',
'node_modules/long/dist/long.js',
'js/util_worker_tasks.js',
],
tasks: ['concat:util_worker'],

@ -19,15 +19,9 @@
"autosize": [
"dist/autosize.js"
],
"bytebuffer": [
"dist/ByteBufferAB.js"
],
"indexeddb-backbonejs-adapter": [
"backbone-indexeddb.js"
],
"long": [
"dist/Long.js"
],
"mock-socket": [
"dist/mock-socket.js"
],
@ -48,8 +42,7 @@
"concat": {
"app": [
"node_modules/jquery/dist/jquery.js",
"components/long/**/*.js",
"components/bytebuffer/**/*.js",
"node_modules/long/dist/long.js",
"components/protobuf/**/*.js",
"node_modules/mustache/mustache.js",
"node_modules/underscore/underscore.js",
@ -61,13 +54,11 @@
"components/multibase/dist/index.js"
],
"libtextsecure": [
"components/long/**/*.js",
"components/bytebuffer/**/*.js",
"node_modules/long/dist/long.js",
"components/protobuf/**/*.js"
],
"libloki": [
"components/long/**/*.js",
"components/bytebuffer/**/*.js",
"node_modules/long/dist/long.js",
"components/JSBI/dist/jsbi.mjs",
"components/multibase/dist/index.js"
]

File diff suppressed because it is too large Load Diff

@ -1,942 +0,0 @@
/*
Copyright 2013 Daniel Wirtz <dcode@dcode.io>
Copyright 2009 The Closure Library Authors. 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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
* Released under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/Long.js for details
*/
(function(global) {
"use strict";
/**
* Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.
* See the from* functions below for more convenient ways of constructing Longs.
* @exports Long
* @class A Long class for representing a 64 bit two's-complement integer value.
* @param {number} low The low (signed) 32 bits of the long
* @param {number} high The high (signed) 32 bits of the long
* @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed
* @constructor
*/
var Long = function(low, high, unsigned) {
/**
* The low 32 bits as a signed value.
* @type {number}
* @expose
*/
this.low = low|0;
/**
* The high 32 bits as a signed value.
* @type {number}
* @expose
*/
this.high = high|0;
/**
* Whether unsigned or not.
* @type {boolean}
* @expose
*/
this.unsigned = !!unsigned;
};
// The internal representation of a long is the two given signed, 32-bit values.
// We use 32-bit pieces because these are the size of integers on which
// Javascript performs bit-operations. For operations like addition and
// multiplication, we split each number into 16 bit pieces, which can easily be
// multiplied within Javascript's floating-point representation without overflow
// or change in sign.
//
// In the algorithms below, we frequently reduce the negative case to the
// positive case by negating the input(s) and then post-processing the result.
// Note that we must ALWAYS check specially whether those values are MIN_VALUE
// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
// a positive number, it overflows back into a negative). Not handling this
// case would often result in infinite recursion.
//
// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*
// methods on which they depend.
/**
* Tests if the specified object is a Long.
* @param {*} obj Object
* @returns {boolean}
* @expose
*/
Long.isLong = function(obj) {
return (obj && obj instanceof Long) === true;
};
/**
* A cache of the Long representations of small integer values.
* @type {!Object}
* @inner
*/
var INT_CACHE = {};
/**
* A cache of the Long representations of small unsigned integer values.
* @type {!Object}
* @inner
*/
var UINT_CACHE = {};
/**
* Returns a Long representing the given 32 bit integer value.
* @param {number} value The 32 bit integer in question
* @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed
* @returns {!Long} The corresponding Long value
* @expose
*/
Long.fromInt = function(value, unsigned) {
var obj, cachedObj;
if (!unsigned) {
value = value | 0;
if (-128 <= value && value < 128) {
cachedObj = INT_CACHE[value];
if (cachedObj)
return cachedObj;
}
obj = new Long(value, value < 0 ? -1 : 0, false);
if (-128 <= value && value < 128)
INT_CACHE[value] = obj;
return obj;
} else {
value = value >>> 0;
if (0 <= value && value < 256) {
cachedObj = UINT_CACHE[value];
if (cachedObj)
return cachedObj;
}
obj = new Long(value, (value | 0) < 0 ? -1 : 0, true);
if (0 <= value && value < 256)
UINT_CACHE[value] = obj;
return obj;
}
};
/**
* Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
* @param {number} value The number in question
* @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed
* @returns {!Long} The corresponding Long value
* @expose
*/
Long.fromNumber = function(value, unsigned) {
unsigned = !!unsigned;
if (isNaN(value) || !isFinite(value))
return Long.ZERO;
if (!unsigned && value <= -TWO_PWR_63_DBL)
return Long.MIN_VALUE;
if (!unsigned && value + 1 >= TWO_PWR_63_DBL)
return Long.MAX_VALUE;
if (unsigned && value >= TWO_PWR_64_DBL)
return Long.MAX_UNSIGNED_VALUE;
if (value < 0)
return Long.fromNumber(-value, unsigned).negate();
return new Long((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);
};
/**
* Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is
* assumed to use 32 bits.
* @param {number} lowBits The low 32 bits
* @param {number} highBits The high 32 bits
* @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed
* @returns {!Long} The corresponding Long value
* @expose
*/
Long.fromBits = function(lowBits, highBits, unsigned) {
return new Long(lowBits, highBits, unsigned);
};
/**
* Returns a Long representation of the given string, written using the specified radix.
* @param {string} str The textual representation of the Long
* @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to `false` for signed
* @param {number=} radix The radix in which the text is written (2-36), defaults to 10
* @returns {!Long} The corresponding Long value
* @expose
*/
Long.fromString = function(str, unsigned, radix) {
if (str.length === 0)
throw Error('number format error: empty string');
if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity")
return Long.ZERO;
if (typeof unsigned === 'number') // For goog.math.long compatibility
radix = unsigned,
unsigned = false;
radix = radix || 10;
if (radix < 2 || 36 < radix)
throw Error('radix out of range: ' + radix);
var p;
if ((p = str.indexOf('-')) > 0)
throw Error('number format error: interior "-" character: ' + str);
else if (p === 0)
return Long.fromString(str.substring(1), unsigned, radix).negate();
// Do several (8) digits each time through the loop, so as to
// minimize the calls to the very expensive emulated div.
var radixToPower = Long.fromNumber(Math.pow(radix, 8));
var result = Long.ZERO;
for (var i = 0; i < str.length; i += 8) {
var size = Math.min(8, str.length - i);
var value = parseInt(str.substring(i, i + size), radix);
if (size < 8) {
var power = Long.fromNumber(Math.pow(radix, size));
result = result.multiply(power).add(Long.fromNumber(value));
} else {
result = result.multiply(radixToPower);
result = result.add(Long.fromNumber(value));
}
}
result.unsigned = unsigned;
return result;
};
/**
* Converts the specified value to a Long.
* @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value
* @returns {!Long}
* @expose
*/
Long.fromValue = function(val) {
if (typeof val === 'number')
return Long.fromNumber(val);
if (typeof val === 'string')
return Long.fromString(val);
if (Long.isLong(val))
return val;
// Throws for not an object (undefined, null):
return new Long(val.low, val.high, val.unsigned);
};
// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be
// no runtime penalty for these.
/**
* @type {number}
* @const
* @inner
*/
var TWO_PWR_16_DBL = 1 << 16;
/**
* @type {number}
* @const
* @inner
*/
var TWO_PWR_24_DBL = 1 << 24;
/**
* @type {number}
* @const
* @inner
*/
var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;
/**
* @type {number}
* @const
* @inner
*/
var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;
/**
* @type {number}
* @const
* @inner
*/
var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;
/**
* @type {!Long}
* @const
* @inner
*/
var TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL);
/**
* Signed zero.
* @type {!Long}
* @expose
*/
Long.ZERO = Long.fromInt(0);
/**
* Unsigned zero.
* @type {!Long}
* @expose
*/
Long.UZERO = Long.fromInt(0, true);
/**
* Signed one.
* @type {!Long}
* @expose
*/
Long.ONE = Long.fromInt(1);
/**
* Unsigned one.
* @type {!Long}
* @expose
*/
Long.UONE = Long.fromInt(1, true);
/**
* Signed negative one.
* @type {!Long}
* @expose
*/
Long.NEG_ONE = Long.fromInt(-1);
/**
* Maximum signed value.
* @type {!Long}
* @expose
*/
Long.MAX_VALUE = Long.fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);
/**
* Maximum unsigned value.
* @type {!Long}
* @expose
*/
Long.MAX_UNSIGNED_VALUE = Long.fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);
/**
* Minimum signed value.
* @type {!Long}
* @expose
*/
Long.MIN_VALUE = Long.fromBits(0, 0x80000000|0, false);
/**
* Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.
* @returns {number}
* @expose
*/
Long.prototype.toInt = function() {
return this.unsigned ? this.low >>> 0 : this.low;
};
/**
* Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).
* @returns {number}
* @expose
*/
Long.prototype.toNumber = function() {
if (this.unsigned) {
return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);
}
return this.high * TWO_PWR_32_DBL + (this.low >>> 0);
};
/**
* Converts the Long to a string written in the specified radix.
* @param {number=} radix Radix (2-36), defaults to 10
* @returns {string}
* @override
* @throws {RangeError} If `radix` is out of range
* @expose
*/
Long.prototype.toString = function(radix) {
radix = radix || 10;
if (radix < 2 || 36 < radix)
throw RangeError('radix out of range: ' + radix);
if (this.isZero())
return '0';
var rem;
if (this.isNegative()) { // Unsigned Longs are never negative
if (this.equals(Long.MIN_VALUE)) {
// We need to change the Long value before it can be negated, so we remove
// the bottom-most digit in this base and then recurse to do the rest.
var radixLong = Long.fromNumber(radix);
var div = this.div(radixLong);
rem = div.multiply(radixLong).subtract(this);
return div.toString(radix) + rem.toInt().toString(radix);
} else
return '-' + this.negate().toString(radix);
}
// Do several (6) digits each time through the loop, so as to
// minimize the calls to the very expensive emulated div.
var radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned);
rem = this;
var result = '';
while (true) {
var remDiv = rem.div(radixToPower),
intval = rem.subtract(remDiv.multiply(radixToPower)).toInt() >>> 0,
digits = intval.toString(radix);
rem = remDiv;
if (rem.isZero())
return digits + result;
else {
while (digits.length < 6)
digits = '0' + digits;
result = '' + digits + result;
}
}
};
/**
* Gets the high 32 bits as a signed integer.
* @returns {number} Signed high bits
* @expose
*/
Long.prototype.getHighBits = function() {
return this.high;
};
/**
* Gets the high 32 bits as an unsigned integer.
* @returns {number} Unsigned high bits
* @expose
*/
Long.prototype.getHighBitsUnsigned = function() {
return this.high >>> 0;
};
/**
* Gets the low 32 bits as a signed integer.
* @returns {number} Signed low bits
* @expose
*/
Long.prototype.getLowBits = function() {
return this.low;
};
/**
* Gets the low 32 bits as an unsigned integer.
* @returns {number} Unsigned low bits
* @expose
*/
Long.prototype.getLowBitsUnsigned = function() {
return this.low >>> 0;
};
/**
* Gets the number of bits needed to represent the absolute value of this Long.
* @returns {number}
* @expose
*/
Long.prototype.getNumBitsAbs = function() {
if (this.isNegative()) // Unsigned Longs are never negative
return this.equals(Long.MIN_VALUE) ? 64 : this.negate().getNumBitsAbs();
var val = this.high != 0 ? this.high : this.low;
for (var bit = 31; bit > 0; bit--)
if ((val & (1 << bit)) != 0)
break;
return this.high != 0 ? bit + 33 : bit + 1;
};
/**
* Tests if this Long's value equals zero.
* @returns {boolean}
* @expose
*/
Long.prototype.isZero = function() {
return this.high === 0 && this.low === 0;
};
/**
* Tests if this Long's value is negative.
* @returns {boolean}
* @expose
*/
Long.prototype.isNegative = function() {
return !this.unsigned && this.high < 0;
};
/**
* Tests if this Long's value is positive.
* @returns {boolean}
* @expose
*/
Long.prototype.isPositive = function() {
return this.unsigned || this.high >= 0;
};
/**
* Tests if this Long's value is odd.
* @returns {boolean}
* @expose
*/
Long.prototype.isOdd = function() {
return (this.low & 1) === 1;
};
/**
* Tests if this Long's value is even.
* @returns {boolean}
* @expose
*/
Long.prototype.isEven = function() {
return (this.low & 1) === 0;
};
/**
* Tests if this Long's value equals the specified's.
* @param {!Long|number|string} other Other value
* @returns {boolean}
* @expose
*/
Long.prototype.equals = function(other) {
if (!Long.isLong(other))
other = Long.fromValue(other);
if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)
return false;
return this.high === other.high && this.low === other.low;
};
/**
* Tests if this Long's value differs from the specified's.
* @param {!Long|number|string} other Other value
* @returns {boolean}
* @expose
*/
Long.prototype.notEquals = function(other) {
if (!Long.isLong(other))
other = Long.fromValue(other);
return !this.equals(other);
};
/**
* Tests if this Long's value is less than the specified's.
* @param {!Long|number|string} other Other value
* @returns {boolean}
* @expose
*/
Long.prototype.lessThan = function(other) {
if (!Long.isLong(other))
other = Long.fromValue(other);
return this.compare(other) < 0;
};
/**
* Tests if this Long's value is less than or equal the specified's.
* @param {!Long|number|string} other Other value
* @returns {boolean}
* @expose
*/
Long.prototype.lessThanOrEqual = function(other) {
if (!Long.isLong(other))
other = Long.fromValue(other);
return this.compare(other) <= 0;
};
/**
* Tests if this Long's value is greater than the specified's.
* @param {!Long|number|string} other Other value
* @returns {boolean}
* @expose
*/
Long.prototype.greaterThan = function(other) {
if (!Long.isLong(other))
other = Long.fromValue(other);
return this.compare(other) > 0;
};
/**
* Tests if this Long's value is greater than or equal the specified's.
* @param {!Long|number|string} other Other value
* @returns {boolean}
* @expose
*/
Long.prototype.greaterThanOrEqual = function(other) {
return this.compare(other) >= 0;
};
/**
* Compares this Long's value with the specified's.
* @param {!Long|number|string} other Other value
* @returns {number} 0 if they are the same, 1 if the this is greater and -1
* if the given one is greater
* @expose
*/
Long.prototype.compare = function(other) {
if (this.equals(other))
return 0;
var thisNeg = this.isNegative(),
otherNeg = other.isNegative();
if (thisNeg && !otherNeg)
return -1;
if (!thisNeg && otherNeg)
return 1;
// At this point the sign bits are the same
if (!this.unsigned)
return this.subtract(other).isNegative() ? -1 : 1;
// Both are positive if at least one is unsigned
return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;
};
/**
* Negates this Long's value.
* @returns {!Long} Negated Long
* @expose
*/
Long.prototype.negate = function() {
if (!this.unsigned && this.equals(Long.MIN_VALUE))
return Long.MIN_VALUE;
return this.not().add(Long.ONE);
};
/**
* Returns the sum of this and the specified Long.
* @param {!Long|number|string} addend Addend
* @returns {!Long} Sum
* @expose
*/
Long.prototype.add = function(addend) {
if (!Long.isLong(addend))
addend = Long.fromValue(addend);
// Divide each number into 4 chunks of 16 bits, and then sum the chunks.
var a48 = this.high >>> 16;
var a32 = this.high & 0xFFFF;
var a16 = this.low >>> 16;
var a00 = this.low & 0xFFFF;
var b48 = addend.high >>> 16;
var b32 = addend.high & 0xFFFF;
var b16 = addend.low >>> 16;
var b00 = addend.low & 0xFFFF;
var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
c00 += a00 + b00;
c16 += c00 >>> 16;
c00 &= 0xFFFF;
c16 += a16 + b16;
c32 += c16 >>> 16;
c16 &= 0xFFFF;
c32 += a32 + b32;
c48 += c32 >>> 16;
c32 &= 0xFFFF;
c48 += a48 + b48;
c48 &= 0xFFFF;
return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);
};
/**
* Returns the difference of this and the specified Long.
* @param {!Long|number|string} subtrahend Subtrahend
* @returns {!Long} Difference
* @expose
*/
Long.prototype.subtract = function(subtrahend) {
if (!Long.isLong(subtrahend))
subtrahend = Long.fromValue(subtrahend);
return this.add(subtrahend.negate());
};
/**
* Returns the product of this and the specified Long.
* @param {!Long|number|string} multiplier Multiplier
* @returns {!Long} Product
* @expose
*/
Long.prototype.multiply = function(multiplier) {
if (this.isZero())
return Long.ZERO;
if (!Long.isLong(multiplier))
multiplier = Long.fromValue(multiplier);
if (multiplier.isZero())
return Long.ZERO;
if (this.equals(Long.MIN_VALUE))
return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO;
if (multiplier.equals(Long.MIN_VALUE))
return this.isOdd() ? Long.MIN_VALUE : Long.ZERO;
if (this.isNegative()) {
if (multiplier.isNegative())
return this.negate().multiply(multiplier.negate());
else
return this.negate().multiply(multiplier).negate();
} else if (multiplier.isNegative())
return this.multiply(multiplier.negate()).negate();
// If both longs are small, use float multiplication
if (this.lessThan(TWO_PWR_24) && multiplier.lessThan(TWO_PWR_24))
return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);
// Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.
// We can skip products that would overflow.
var a48 = this.high >>> 16;
var a32 = this.high & 0xFFFF;
var a16 = this.low >>> 16;
var a00 = this.low & 0xFFFF;
var b48 = multiplier.high >>> 16;
var b32 = multiplier.high & 0xFFFF;
var b16 = multiplier.low >>> 16;
var b00 = multiplier.low & 0xFFFF;
var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
c00 += a00 * b00;
c16 += c00 >>> 16;
c00 &= 0xFFFF;
c16 += a16 * b00;
c32 += c16 >>> 16;
c16 &= 0xFFFF;
c16 += a00 * b16;
c32 += c16 >>> 16;
c16 &= 0xFFFF;
c32 += a32 * b00;
c48 += c32 >>> 16;
c32 &= 0xFFFF;
c32 += a16 * b16;
c48 += c32 >>> 16;
c32 &= 0xFFFF;
c32 += a00 * b32;
c48 += c32 >>> 16;
c32 &= 0xFFFF;
c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
c48 &= 0xFFFF;
return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);
};
/**
* Returns this Long divided by the specified.
* @param {!Long|number|string} divisor Divisor
* @returns {!Long} Quotient
* @expose
*/
Long.prototype.div = function(divisor) {
if (!Long.isLong(divisor))
divisor = Long.fromValue(divisor);
if (divisor.isZero())
throw(new Error('division by zero'));
if (this.isZero())
return this.unsigned ? Long.UZERO : Long.ZERO;
var approx, rem, res;
if (this.equals(Long.MIN_VALUE)) {
if (divisor.equals(Long.ONE) || divisor.equals(Long.NEG_ONE))
return Long.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
else if (divisor.equals(Long.MIN_VALUE))
return Long.ONE;
else {
// At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
var halfThis = this.shiftRight(1);
approx = halfThis.div(divisor).shiftLeft(1);
if (approx.equals(Long.ZERO)) {
return divisor.isNegative() ? Long.ONE : Long.NEG_ONE;
} else {
rem = this.subtract(divisor.multiply(approx));
res = approx.add(rem.div(divisor));
return res;
}
}
} else if (divisor.equals(Long.MIN_VALUE))
return this.unsigned ? Long.UZERO : Long.ZERO;
if (this.isNegative()) {
if (divisor.isNegative())
return this.negate().div(divisor.negate());
return this.negate().div(divisor).negate();
} else if (divisor.isNegative())
return this.div(divisor.negate()).negate();
// Repeat the following until the remainder is less than other: find a
// floating-point that approximates remainder / other *from below*, add this
// into the result, and subtract it from the remainder. It is critical that
// the approximate value is less than or equal to the real value so that the
// remainder never becomes negative.
res = Long.ZERO;
rem = this;
while (rem.greaterThanOrEqual(divisor)) {
// Approximate the result of division. This may be a little greater or
// smaller than the actual value.
approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));
// We will tweak the approximate result by changing it in the 48-th digit or
// the smallest non-fractional digit, whichever is larger.
var log2 = Math.ceil(Math.log(approx) / Math.LN2),
delta = (log2 <= 48) ? 1 : Math.pow(2, log2 - 48),
// Decrease the approximation until it is smaller than the remainder. Note
// that if it is too large, the product overflows and is negative.
approxRes = Long.fromNumber(approx),
approxRem = approxRes.multiply(divisor);
while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
approx -= delta;
approxRes = Long.fromNumber(approx, this.unsigned);
approxRem = approxRes.multiply(divisor);
}
// We know the answer can't be zero... and actually, zero would cause
// infinite recursion since we would make no progress.
if (approxRes.isZero())
approxRes = Long.ONE;
res = res.add(approxRes);
rem = rem.subtract(approxRem);
}
return res;
};
/**
* Returns this Long modulo the specified.
* @param {!Long|number|string} divisor Divisor
* @returns {!Long} Remainder
* @expose
*/
Long.prototype.modulo = function(divisor) {
if (!Long.isLong(divisor))
divisor = Long.fromValue(divisor);
return this.subtract(this.div(divisor).multiply(divisor));
};
/**
* Returns the bitwise NOT of this Long.
* @returns {!Long}
* @expose
*/
Long.prototype.not = function() {
return Long.fromBits(~this.low, ~this.high, this.unsigned);
};
/**
* Returns the bitwise AND of this Long and the specified.
* @param {!Long|number|string} other Other Long
* @returns {!Long}
* @expose
*/
Long.prototype.and = function(other) {
if (!Long.isLong(other))
other = Long.fromValue(other);
return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned);
};
/**
* Returns the bitwise OR of this Long and the specified.
* @param {!Long|number|string} other Other Long
* @returns {!Long}
* @expose
*/
Long.prototype.or = function(other) {
if (!Long.isLong(other))
other = Long.fromValue(other);
return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned);
};
/**
* Returns the bitwise XOR of this Long and the given one.
* @param {!Long|number|string} other Other Long
* @returns {!Long}
* @expose
*/
Long.prototype.xor = function(other) {
if (!Long.isLong(other))
other = Long.fromValue(other);
return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);
};
/**
* Returns this Long with bits shifted to the left by the given amount.
* @param {number|!Long} numBits Number of bits
* @returns {!Long} Shifted Long
* @expose
*/
Long.prototype.shiftLeft = function(numBits) {
if (Long.isLong(numBits))
numBits = numBits.toInt();
if ((numBits &= 63) === 0)
return this;
else if (numBits < 32)
return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);
else
return Long.fromBits(0, this.low << (numBits - 32), this.unsigned);
};
/**
* Returns this Long with bits arithmetically shifted to the right by the given amount.
* @param {number|!Long} numBits Number of bits
* @returns {!Long} Shifted Long
* @expose
*/
Long.prototype.shiftRight = function(numBits) {
if (Long.isLong(numBits))
numBits = numBits.toInt();
if ((numBits &= 63) === 0)
return this;
else if (numBits < 32)
return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);
else
return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);
};
/**
* Returns this Long with bits logically shifted to the right by the given amount.
* @param {number|!Long} numBits Number of bits
* @returns {!Long} Shifted Long
* @expose
*/
Long.prototype.shiftRightUnsigned = function(numBits) {
if (Long.isLong(numBits))
numBits = numBits.toInt();
numBits &= 63;
if (numBits === 0)
return this;
else {
var high = this.high;
if (numBits < 32) {
var low = this.low;
return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);
} else if (numBits === 32)
return Long.fromBits(high, 0, this.unsigned);
else
return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned);
}
};
/**
* Converts this Long to signed.
* @returns {!Long} Signed long
* @expose
*/
Long.prototype.toSigned = function() {
if (!this.unsigned)
return this;
return new Long(this.low, this.high, false);
};
/**
* Converts this Long to unsigned.
* @returns {!Long} Unsigned long
* @expose
*/
Long.prototype.toUnsigned = function() {
if (this.unsigned)
return this;
return new Long(this.low, this.high, true);
};
/* CommonJS */ if (typeof require === 'function' && typeof module === 'object' && module && typeof exports === 'object' && exports)
module["exports"] = Long;
/* AMD */ else if (typeof define === 'function' && define["amd"])
define(function() { return Long; });
/* Global */ else
(global["dcodeIO"] = global["dcodeIO"] || {})["Long"] = Long;
})(this);

@ -61,6 +61,7 @@
"blueimp-load-image": "2.18.0",
"buffer-crc32": "0.2.13",
"bunyan": "1.8.12",
"bytebuffer": "^5.0.1",
"classnames": "2.2.5",
"color": "^3.1.2",
"config": "1.28.1",
@ -84,6 +85,7 @@
"libsodium-wrappers": "^0.7.6",
"linkify-it": "2.0.3",
"lodash": "4.17.11",
"long": "^4.0.0",
"mkdirp": "0.5.1",
"moment": "2.21.0",
"mustache": "2.3.0",
@ -116,6 +118,7 @@
},
"devDependencies": {
"@types/backbone": "^1.4.2",
"@types/bytebuffer": "^5.0.41",
"@types/chai": "4.1.2",
"@types/chai-as-promised": "^7.1.2",
"@types/classnames": "2.2.3",

@ -27,6 +27,9 @@ if (config.appInstance) {
window.Lodash = require('lodash');
global.dcodeIO = global.dcodeIO || {};
global.dcodeIO.ByteBuffer = require('bytebuffer');
// Regex to match all characters which are *not* supported in display names
window.displayNameRegex = /[^\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC _0-9]*/g;

@ -11,6 +11,7 @@ import { trigger } from '../../shims/events';
import { SessionHtmlRenderer } from './SessionHTMLRenderer';
import { SessionIdEditable } from './SessionIdEditable';
import { SessionSpinner } from './SessionSpinner';
import { StringUtils } from '../../session/utils';
enum SignInMode {
Default,
@ -178,7 +179,7 @@ export class RegistrationTabs extends React.Component<{}, State> {
'hex'
).toArrayBuffer();
const keyPair = await window.libsignal.Curve.async.createKeyPair(seed);
const hexGeneratedPubKey = Buffer.from(keyPair.pubKey).toString('hex');
const hexGeneratedPubKey = StringUtils.decode(keyPair.pubKey, 'hex');
this.setState({
generatedMnemonicSeed: mnemonic,

@ -7,7 +7,7 @@ import {
} from '../../../js/modules/data';
import { PrimaryPubKey, PubKey, SecondaryPubKey } from '../types';
import { UserUtil } from '../../util';
import { BufferUtils } from '../utils';
import { StringUtils } from '../utils';
/*
The reason we're exporing a class here instead of just exporting the functions directly is for the sake of testing.
@ -93,9 +93,8 @@ export class MultiDeviceProtocol {
}) => ({
primaryDevicePubKey,
secondaryDevicePubKey,
requestSignature: BufferUtils.base64toUint8Array(requestSignature)
.buffer,
grantSignature: BufferUtils.base64toUint8Array(grantSignature).buffer,
requestSignature: StringUtils.encode(requestSignature, 'base64'),
grantSignature: StringUtils.encode(grantSignature, 'base64'),
})
);
}

@ -1,18 +0,0 @@
/**
* Convert base64 string into a Uint8Array.
*
* The reason for this function is to avoid a very weird issue when converting to and from base64.
* ```
* const base64 = <base64string>;
* const arrayBuffer = Buffer.from(base64, 'base64').buffer;
* const reconstructedBase64 = Buffer.from(arrayBuffer).toString('base64');
* expect(base64 === reconstructedBase64) // This returns false!!
* ```
*
* I have no idea why that doesn't work but a work around is to wrap the original base64 buffer in a Uin8Array before calling `buffer` on it.
*
* @param base64 The base 64 string.
*/
export function base64toUint8Array(base64: string): Uint8Array {
return new Uint8Array(Buffer.from(base64, 'base64'));
}

@ -0,0 +1,22 @@
import ByteBuffer from 'bytebuffer';
type Encoding = 'base64' | 'hex' | 'binary' | 'utf8';
type BufferType = ByteBuffer | Buffer | ArrayBuffer | Uint8Array;
/**
* Take a string value with the given encoding and converts it to an `ArrayBuffer`.
* @param value The string value.
* @param encoding The encoding of the string value.
*/
export function encode(value: string, encoding: Encoding): ArrayBuffer {
return ByteBuffer.wrap(value, encoding).toArrayBuffer();
}
/**
* Take a buffer and convert it to a string with the given encoding.
* @param buffer The buffer.
* @param stringEncoding The encoding of the converted string value.
*/
export function decode(buffer: BufferType, stringEncoding: Encoding): string {
return ByteBuffer.wrap(buffer).toString(stringEncoding);
}

@ -1,9 +1,9 @@
import * as MessageUtils from './Messages';
import * as GroupUtils from './Groups';
import * as SyncMessageUtils from './SyncMessageUtils';
import * as BufferUtils from './Buffer';
import * as StringUtils from './String';
export * from './TypedEmitter';
export * from './JobQueue';
export { MessageUtils, SyncMessageUtils, GroupUtils, BufferUtils };
export { MessageUtils, SyncMessageUtils, GroupUtils, StringUtils };

@ -5,6 +5,7 @@ import { PairingAuthorisation } from '../../../../js/modules/data';
import { MultiDeviceProtocol } from '../../../session/protocols';
import { PubKey } from '../../../session/types';
import { UserUtil } from '../../../util';
import { StringUtils } from '../../../session/utils';
function generateFakeAuthorisations(
primary: PubKey,
@ -112,7 +113,7 @@ describe('MultiDeviceProtocol', () => {
} = authorisations[0];
expect(primaryDevicePubKey).to.equal(networkAuth.primaryDevicePubKey);
expect(secondaryDevicePubKey).to.equal(networkAuth.secondaryDevicePubKey);
expect(Buffer.from(requestSignature).toString('base64')).to.equal(
expect(StringUtils.decode(requestSignature, 'base64')).to.equal(
networkAuth.requestSignature
);
expect(grantSignature).to.not.equal(
@ -120,7 +121,7 @@ describe('MultiDeviceProtocol', () => {
'Grant signature should not be undefined.'
);
// tslint:disable-next-line: no-non-null-assertion
expect(Buffer.from(grantSignature!).toString('base64')).to.equal(
expect(StringUtils.decode(grantSignature!, 'base64')).to.equal(
networkAuth.grantSignature
);
});

@ -1,11 +1,12 @@
import { CipherTextObject } from '../../../../../libtextsecure/libsignal-protocol';
import { SignalService } from '../../../../protobuf';
import { StringUtils } from '../../../../session/utils';
export class FallBackSessionCipherStub {
public async encrypt(buffer: ArrayBuffer): Promise<CipherTextObject> {
return {
type: SignalService.Envelope.Type.SESSION_REQUEST,
body: Buffer.from(buffer).toString('binary'),
body: StringUtils.decode(buffer, 'binary'),
};
}
}

@ -1,6 +1,7 @@
import { SignalService } from '../../../../protobuf';
import { CipherTextObject } from '../../../../../libtextsecure/libsignal-protocol';
import { SecretSessionCipherInterface } from '../../../../../js/modules/metadata/SecretSessionCipher';
import { StringUtils } from '../../../../session/utils';
export class SecretSessionCipherStub implements SecretSessionCipherInterface {
public async encrypt(
@ -10,7 +11,7 @@ export class SecretSessionCipherStub implements SecretSessionCipherInterface {
): Promise<ArrayBuffer> {
const { body } = innerEncryptedMessage;
return Buffer.from(body, 'binary').buffer;
return StringUtils.encode(body, 'binary');
}
public async decrypt(

@ -3,6 +3,7 @@ import {
SessionCipher,
} from '../../../../../libtextsecure/libsignal-protocol';
import { SignalService } from '../../../../protobuf';
import { StringUtils } from '../../../../session/utils';
export class SessionCipherStub implements SessionCipher {
public storage: any;
@ -17,7 +18,7 @@ export class SessionCipherStub implements SessionCipher {
): Promise<CipherTextObject> {
return {
type: SignalService.Envelope.Type.CIPHERTEXT,
body: Buffer.from(buffer).toString('binary'),
body: StringUtils.decode(buffer, 'binary'),
};
}

@ -171,6 +171,14 @@
"@types/jquery" "*"
"@types/underscore" "*"
"@types/bytebuffer@^5.0.41":
version "5.0.41"
resolved "https://registry.yarnpkg.com/@types/bytebuffer/-/bytebuffer-5.0.41.tgz#6850dba4d4cd2846596b4842874d5bfc01cd3db1"
integrity sha512-Mdrv4YcaHvpkx25ksqqFaezktx3yZRcd51GZY0rY/9avyaqZdiT/GiWRhfrJhMpgzXqTOSHgGvsumGxJFNiZZA==
dependencies:
"@types/long" "*"
"@types/node" "*"
"@types/chai-as-promised@^7.1.2":
version "7.1.2"
resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-7.1.2.tgz#2f564420e81eaf8650169e5a3a6b93e096e5068b"
@ -293,6 +301,11 @@
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.106.tgz#6093e9a02aa567ddecfe9afadca89e53e5dce4dd"
integrity sha512-tOSvCVrvSqFZ4A/qrqqm6p37GZoawsZtoR0SJhlF7EonNZUgrn8FfT+RNQ11h+NUpMt6QVe36033f3qEKBwfWA==
"@types/long@*":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9"
integrity sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==
"@types/long@^3.0.32":
version "3.0.32"
resolved "https://registry.yarnpkg.com/@types/long/-/long-3.0.32.tgz#f4e5af31e9e9b196d8e5fca8a5e2e20aa3d60b69"
@ -1540,6 +1553,13 @@ bunyan@1.8.12:
mv "~2"
safe-json-stringify "~1"
bytebuffer@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd"
integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=
dependencies:
long "~3"
bytes@2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/bytes/-/bytes-2.2.0.tgz#fd35464a403f6f9117c2de3609ecff9cae000588"
@ -5989,6 +6009,11 @@ long@^4.0.0:
resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28"
integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==
long@~3:
version "3.2.0"
resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b"
integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=
longest-streak@^2.0.1:
version "2.0.4"
resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.4.tgz#b8599957da5b5dab64dee3fe316fa774597d90e4"

Loading…
Cancel
Save