From 1a0b987d1a56ef2b93abe7e23b87063fe28d1780 Mon Sep 17 00:00:00 2001 From: Bouke van der Bijl Date: Fri, 28 Oct 2022 15:40:24 +0200 Subject: [PATCH] Allow passing uint8array to update --- build/xxhash.js | 574 ++++++++++++++++++-------------------------- build/xxhash.min.js | 5 +- lib/xxhash.js | 9 +- lib/xxhash64.js | 9 +- 4 files changed, 241 insertions(+), 356 deletions(-) diff --git a/build/xxhash.js b/build/xxhash.js index 64f0f22..5c16402 100644 --- a/build/xxhash.js +++ b/build/xxhash.js @@ -7,7 +7,7 @@ exports["XXH"] = factory(); else root["XXH"] = factory(); -})(this, function() { +})(typeof self !== 'undefined' ? self : this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -81,7 +81,7 @@ return /******/ (function(modules) { // webpackBootstrap /* WEBPACK VAR INJECTION */(function(global) {/*! * The buffer module from node.js, for the browser. * - * @author Feross Aboukhadijeh + * @author Feross Aboukhadijeh * @license MIT */ /* eslint-disable no-proto */ @@ -2030,25 +2030,26 @@ XXH.prototype.init = init /** * Add data to be computed for the XXH hash * @method update - * @param {String|Buffer|ArrayBuffer} input as a string or nodejs Buffer or ArrayBuffer + * @param {String|Buffer|ArrayBuffer|Uint8Array} input as a string or nodejs Buffer or ArrayBuffer or Uint8Array * @return ThisExpression */ XXH.prototype.update = function (input) { - var isString = typeof input == 'string' var isArrayBuffer // Convert all strings to utf-8 first (issue #5) - if (isString) { + if (typeof input == 'string') { input = toUTF8Array(input) - isString = false isArrayBuffer = true } - - if (typeof ArrayBuffer !== "undefined" && input instanceof ArrayBuffer) + else if (typeof ArrayBuffer !== "undefined" && input instanceof ArrayBuffer) { isArrayBuffer = true input = new Uint8Array(input); } + else if (input instanceof Uint8Array) + { + isArrayBuffer = true + } var p = 0 var len = input.length @@ -2060,9 +2061,7 @@ XXH.prototype.update = function (input) { if (this.memsize == 0) { - if (isString) { - this.memory = '' - } else if (isArrayBuffer) { + if (isArrayBuffer) { this.memory = new Uint8Array(16) } else { this.memory = new Buffer(16) @@ -2072,9 +2071,7 @@ XXH.prototype.update = function (input) { if (this.memsize + len < 16) // fill in tmp buffer { // XXH_memcpy(this.memory + this.memsize, input, len) - if (isString) { - this.memory += input - } else if (isArrayBuffer) { + if (isArrayBuffer) { this.memory.set( input.subarray(0, len), this.memsize ) } else { input.copy( this.memory, this.memsize, 0, len ) @@ -2087,60 +2084,35 @@ XXH.prototype.update = function (input) { if (this.memsize > 0) // some data left from previous update { // XXH_memcpy(this.memory + this.memsize, input, 16-this.memsize); - if (isString) { - this.memory += input.slice(0, 16 - this.memsize) - } else if (isArrayBuffer) { + if (isArrayBuffer) { this.memory.set( input.subarray(0, 16 - this.memsize), this.memsize ) } else { input.copy( this.memory, this.memsize, 0, 16 - this.memsize ) } var p32 = 0 - if (isString) { - this.v1.xxh_update( - (this.memory.charCodeAt(p32+1) << 8) | this.memory.charCodeAt(p32) - , (this.memory.charCodeAt(p32+3) << 8) | this.memory.charCodeAt(p32+2) - ) - p32 += 4 - this.v2.xxh_update( - (this.memory.charCodeAt(p32+1) << 8) | this.memory.charCodeAt(p32) - , (this.memory.charCodeAt(p32+3) << 8) | this.memory.charCodeAt(p32+2) - ) - p32 += 4 - this.v3.xxh_update( - (this.memory.charCodeAt(p32+1) << 8) | this.memory.charCodeAt(p32) - , (this.memory.charCodeAt(p32+3) << 8) | this.memory.charCodeAt(p32+2) - ) - p32 += 4 - this.v4.xxh_update( - (this.memory.charCodeAt(p32+1) << 8) | this.memory.charCodeAt(p32) - , (this.memory.charCodeAt(p32+3) << 8) | this.memory.charCodeAt(p32+2) - ) - } else { - this.v1.xxh_update( - (this.memory[p32+1] << 8) | this.memory[p32] - , (this.memory[p32+3] << 8) | this.memory[p32+2] - ) - p32 += 4 - this.v2.xxh_update( - (this.memory[p32+1] << 8) | this.memory[p32] - , (this.memory[p32+3] << 8) | this.memory[p32+2] - ) - p32 += 4 - this.v3.xxh_update( - (this.memory[p32+1] << 8) | this.memory[p32] - , (this.memory[p32+3] << 8) | this.memory[p32+2] - ) - p32 += 4 - this.v4.xxh_update( - (this.memory[p32+1] << 8) | this.memory[p32] - , (this.memory[p32+3] << 8) | this.memory[p32+2] - ) - } + this.v1.xxh_update( + (this.memory[p32+1] << 8) | this.memory[p32] + , (this.memory[p32+3] << 8) | this.memory[p32+2] + ) + p32 += 4 + this.v2.xxh_update( + (this.memory[p32+1] << 8) | this.memory[p32] + , (this.memory[p32+3] << 8) | this.memory[p32+2] + ) + p32 += 4 + this.v3.xxh_update( + (this.memory[p32+1] << 8) | this.memory[p32] + , (this.memory[p32+3] << 8) | this.memory[p32+2] + ) + p32 += 4 + this.v4.xxh_update( + (this.memory[p32+1] << 8) | this.memory[p32] + , (this.memory[p32+3] << 8) | this.memory[p32+2] + ) p += 16 - this.memsize this.memsize = 0 - if (isString) this.memory = '' } if (p <= bEnd - 16) @@ -2149,47 +2121,25 @@ XXH.prototype.update = function (input) { do { - if (isString) { - this.v1.xxh_update( - (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) - , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) - ) - p += 4 - this.v2.xxh_update( - (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) - , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) - ) - p += 4 - this.v3.xxh_update( - (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) - , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) - ) - p += 4 - this.v4.xxh_update( - (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) - , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) - ) - } else { - this.v1.xxh_update( - (input[p+1] << 8) | input[p] - , (input[p+3] << 8) | input[p+2] - ) - p += 4 - this.v2.xxh_update( - (input[p+1] << 8) | input[p] - , (input[p+3] << 8) | input[p+2] - ) - p += 4 - this.v3.xxh_update( - (input[p+1] << 8) | input[p] - , (input[p+3] << 8) | input[p+2] - ) - p += 4 - this.v4.xxh_update( - (input[p+1] << 8) | input[p] - , (input[p+3] << 8) | input[p+2] - ) - } + this.v1.xxh_update( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + ) + p += 4 + this.v2.xxh_update( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + ) + p += 4 + this.v3.xxh_update( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + ) + p += 4 + this.v4.xxh_update( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + ) p += 4 } while (p <= limit) } @@ -2197,9 +2147,7 @@ XXH.prototype.update = function (input) { if (p < bEnd) { // XXH_memcpy(this.memory, p, bEnd-p); - if (isString) { - this.memory += input.slice(p) - } else if (isArrayBuffer) { + if (isArrayBuffer) { this.memory.set( input.subarray(p, bEnd), this.memsize ) } else { input.copy( this.memory, this.memsize, p, bEnd ) @@ -2218,7 +2166,6 @@ XXH.prototype.update = function (input) { */ XXH.prototype.digest = function () { var input = this.memory - var isString = typeof input == 'string' var p = 0 var bEnd = this.memsize var h32, h @@ -2237,17 +2184,10 @@ XXH.prototype.digest = function () { while (p <= bEnd - 4) { - if (isString) { - u.fromBits( - (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) - , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) - ) - } else { - u.fromBits( - (input[p+1] << 8) | input[p] - , (input[p+3] << 8) | input[p+2] - ) - } + u.fromBits( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + ) h32 .add( u.multiply(PRIME32_3) ) .rotl(17) @@ -2257,7 +2197,7 @@ XXH.prototype.digest = function () { while (p < bEnd) { - u.fromBits( isString ? input.charCodeAt(p++) : input[p++], 0 ) + u.fromBits( input[p++], 0 ) h32 .add( u.multiply(PRIME32_5) ) .rotl(11) @@ -2331,68 +2271,103 @@ for (var i = 0, len = code.length; i < len; ++i) { revLookup[code.charCodeAt(i)] = i } +// Support decoding URL-safe base64 strings, as Node.js does. +// See: https://en.wikipedia.org/wiki/Base64#URL_applications revLookup['-'.charCodeAt(0)] = 62 revLookup['_'.charCodeAt(0)] = 63 -function placeHoldersCount (b64) { +function getLens (b64) { var len = b64.length + if (len % 4 > 0) { throw new Error('Invalid string. Length must be a multiple of 4') } - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('=') + if (validLen === -1) validLen = len + + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4) + + return [validLen, placeHoldersLen] } +// base64 is 4/3 + up to two characters of the original data function byteLength (b64) { - // base64 is 4/3 + up to two characters of the original data - return (b64.length * 3 / 4) - placeHoldersCount(b64) + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function toByteArray (b64) { - var i, l, tmp, placeHolders, arr - var len = b64.length - placeHolders = placeHoldersCount(b64) + var tmp + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] - arr = new Arr((len * 3 / 4) - placeHolders) + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) + + var curByte = 0 // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? len - 4 : len + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen - var L = 0 + var i + for (i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)] + arr[curByte++] = (tmp >> 16) & 0xFF + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } - for (i = 0; i < l; i += 4) { - tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] - arr[L++] = (tmp >> 16) & 0xFF - arr[L++] = (tmp >> 8) & 0xFF - arr[L++] = tmp & 0xFF + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[curByte++] = tmp & 0xFF } - if (placeHolders === 2) { - tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[L++] = tmp & 0xFF - } else if (placeHolders === 1) { - tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[L++] = (tmp >> 8) & 0xFF - arr[L++] = tmp & 0xFF + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF } return arr } function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] } function encodeChunk (uint8, start, end) { var tmp var output = [] for (var i = start; i < end; i += 3) { - tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF) output.push(tripletToBase64(tmp)) } return output.join('') @@ -2402,7 +2377,6 @@ function fromByteArray (uint8) { var tmp var len = uint8.length var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var output = '' var parts = [] var maxChunkLength = 16383 // must be multiple of 3 @@ -2414,19 +2388,21 @@ function fromByteArray (uint8) { // pad the end with zeros, but make sure to not forget the extra bytes if (extraBytes === 1) { tmp = uint8[len - 1] - output += lookup[tmp >> 2] - output += lookup[(tmp << 4) & 0x3F] - output += '==' + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ) } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + (uint8[len - 1]) - output += lookup[tmp >> 10] - output += lookup[(tmp >> 4) & 0x3F] - output += lookup[(tmp << 2) & 0x3F] - output += '=' + tmp = (uint8[len - 2] << 8) + uint8[len - 1] + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ) } - parts.push(output) - return parts.join('') } @@ -2435,9 +2411,10 @@ function fromByteArray (uint8) { /* 6 */ /***/ (function(module, exports) { +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m - var eLen = nBytes * 8 - mLen - 1 + var eLen = (nBytes * 8) - mLen - 1 var eMax = (1 << eLen) - 1 var eBias = eMax >> 1 var nBits = -7 @@ -2450,12 +2427,12 @@ exports.read = function (buffer, offset, isLE, mLen, nBytes) { e = s & ((1 << (-nBits)) - 1) s >>= (-nBits) nBits += eLen - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} m = e & ((1 << (-nBits)) - 1) e >>= (-nBits) nBits += mLen - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} if (e === 0) { e = 1 - eBias @@ -2470,7 +2447,7 @@ exports.read = function (buffer, offset, isLE, mLen, nBytes) { exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { var e, m, c - var eLen = nBytes * 8 - mLen - 1 + var eLen = (nBytes * 8) - mLen - 1 var eMax = (1 << eLen) - 1 var eBias = eMax >> 1 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) @@ -2503,7 +2480,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { m = 0 e = eMax } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen) + m = ((value * c) - 1) * Math.pow(2, mLen) e = e + eBias } else { m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) @@ -2975,9 +2952,9 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** if (true) { // AMD / RequireJS - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return UINT32 - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) } else if (typeof module != 'undefined' && module.exports) { // Node.js @@ -3630,9 +3607,9 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** if (true) { // AMD / RequireJS - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return UINT64 - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) } else if (typeof module != 'undefined' && module.exports) { // Node.js @@ -3746,25 +3723,26 @@ XXH64.prototype.init = init /** * Add data to be computed for the XXH64 hash * @method update - * @param {String|Buffer|ArrayBuffer} input as a string or nodejs Buffer or ArrayBuffer + * @param {String|Buffer|ArrayBuffer|Uint8Array} input as a string or nodejs Buffer or ArrayBuffer or Uint8Array * @return ThisExpression */ XXH64.prototype.update = function (input) { - var isString = typeof input == 'string' var isArrayBuffer // Convert all strings to utf-8 first (issue #5) - if (isString) { + if (typeof input == 'string') { input = toUTF8Array(input) - isString = false isArrayBuffer = true } - - if (typeof ArrayBuffer !== "undefined" && input instanceof ArrayBuffer) + else if (typeof ArrayBuffer !== "undefined" && input instanceof ArrayBuffer) { isArrayBuffer = true input = new Uint8Array(input); } + else if (input instanceof Uint8Array) + { + isArrayBuffer = true + } var p = 0 var len = input.length @@ -3776,9 +3754,7 @@ XXH64.prototype.update = function (input) { if (this.memsize == 0) { - if (isString) { - this.memory = '' - } else if (isArrayBuffer) { + if (isArrayBuffer) { this.memory = new Uint8Array(32) } else { this.memory = new Buffer(32) @@ -3788,9 +3764,7 @@ XXH64.prototype.update = function (input) { if (this.memsize + len < 32) // fill in tmp buffer { // XXH64_memcpy(this.memory + this.memsize, input, len) - if (isString) { - this.memory += input - } else if (isArrayBuffer) { + if (isArrayBuffer) { this.memory.set( input.subarray(0, len), this.memsize ) } else { input.copy( this.memory, this.memsize, 0, len ) @@ -3803,161 +3777,88 @@ XXH64.prototype.update = function (input) { if (this.memsize > 0) // some data left from previous update { // XXH64_memcpy(this.memory + this.memsize, input, 16-this.memsize); - if (isString) { - this.memory += input.slice(0, 32 - this.memsize) - } else if (isArrayBuffer) { + if (isArrayBuffer) { this.memory.set( input.subarray(0, 32 - this.memsize), this.memsize ) } else { input.copy( this.memory, this.memsize, 0, 32 - this.memsize ) } var p64 = 0 - if (isString) { - var other - other = UINT64( - (this.memory.charCodeAt(p64+1) << 8) | this.memory.charCodeAt(p64) - , (this.memory.charCodeAt(p64+3) << 8) | this.memory.charCodeAt(p64+2) - , (this.memory.charCodeAt(p64+5) << 8) | this.memory.charCodeAt(p64+4) - , (this.memory.charCodeAt(p64+7) << 8) | this.memory.charCodeAt(p64+6) - ) - this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - p64 += 8 - other = UINT64( - (this.memory.charCodeAt(p64+1) << 8) | this.memory.charCodeAt(p64) - , (this.memory.charCodeAt(p64+3) << 8) | this.memory.charCodeAt(p64+2) - , (this.memory.charCodeAt(p64+5) << 8) | this.memory.charCodeAt(p64+4) - , (this.memory.charCodeAt(p64+7) << 8) | this.memory.charCodeAt(p64+6) - ) - this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - p64 += 8 - other = UINT64( - (this.memory.charCodeAt(p64+1) << 8) | this.memory.charCodeAt(p64) - , (this.memory.charCodeAt(p64+3) << 8) | this.memory.charCodeAt(p64+2) - , (this.memory.charCodeAt(p64+5) << 8) | this.memory.charCodeAt(p64+4) - , (this.memory.charCodeAt(p64+7) << 8) | this.memory.charCodeAt(p64+6) - ) - this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - p64 += 8 - other = UINT64( - (this.memory.charCodeAt(p64+1) << 8) | this.memory.charCodeAt(p64) - , (this.memory.charCodeAt(p64+3) << 8) | this.memory.charCodeAt(p64+2) - , (this.memory.charCodeAt(p64+5) << 8) | this.memory.charCodeAt(p64+4) - , (this.memory.charCodeAt(p64+7) << 8) | this.memory.charCodeAt(p64+6) - ) - this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - } else { + var other + other = UINT64( + (this.memory[p64+1] << 8) | this.memory[p64] + , (this.memory[p64+3] << 8) | this.memory[p64+2] + , (this.memory[p64+5] << 8) | this.memory[p64+4] + , (this.memory[p64+7] << 8) | this.memory[p64+6] + ) + this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p64 += 8 + other = UINT64( + (this.memory[p64+1] << 8) | this.memory[p64] + , (this.memory[p64+3] << 8) | this.memory[p64+2] + , (this.memory[p64+5] << 8) | this.memory[p64+4] + , (this.memory[p64+7] << 8) | this.memory[p64+6] + ) + this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p64 += 8 + other = UINT64( + (this.memory[p64+1] << 8) | this.memory[p64] + , (this.memory[p64+3] << 8) | this.memory[p64+2] + , (this.memory[p64+5] << 8) | this.memory[p64+4] + , (this.memory[p64+7] << 8) | this.memory[p64+6] + ) + this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p64 += 8 + other = UINT64( + (this.memory[p64+1] << 8) | this.memory[p64] + , (this.memory[p64+3] << 8) | this.memory[p64+2] + , (this.memory[p64+5] << 8) | this.memory[p64+4] + , (this.memory[p64+7] << 8) | this.memory[p64+6] + ) + this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + + p += 32 - this.memsize + this.memsize = 0 + } + + if (p <= bEnd - 32) + { + var limit = bEnd - 32 + + do + { var other other = UINT64( - (this.memory[p64+1] << 8) | this.memory[p64] - , (this.memory[p64+3] << 8) | this.memory[p64+2] - , (this.memory[p64+5] << 8) | this.memory[p64+4] - , (this.memory[p64+7] << 8) | this.memory[p64+6] + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + , (input[p+5] << 8) | input[p+4] + , (input[p+7] << 8) | input[p+6] ) this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - p64 += 8 + p += 8 other = UINT64( - (this.memory[p64+1] << 8) | this.memory[p64] - , (this.memory[p64+3] << 8) | this.memory[p64+2] - , (this.memory[p64+5] << 8) | this.memory[p64+4] - , (this.memory[p64+7] << 8) | this.memory[p64+6] + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + , (input[p+5] << 8) | input[p+4] + , (input[p+7] << 8) | input[p+6] ) this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - p64 += 8 + p += 8 other = UINT64( - (this.memory[p64+1] << 8) | this.memory[p64] - , (this.memory[p64+3] << 8) | this.memory[p64+2] - , (this.memory[p64+5] << 8) | this.memory[p64+4] - , (this.memory[p64+7] << 8) | this.memory[p64+6] + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + , (input[p+5] << 8) | input[p+4] + , (input[p+7] << 8) | input[p+6] ) this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - p64 += 8 + p += 8 other = UINT64( - (this.memory[p64+1] << 8) | this.memory[p64] - , (this.memory[p64+3] << 8) | this.memory[p64+2] - , (this.memory[p64+5] << 8) | this.memory[p64+4] - , (this.memory[p64+7] << 8) | this.memory[p64+6] + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + , (input[p+5] << 8) | input[p+4] + , (input[p+7] << 8) | input[p+6] ) this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - } - - p += 32 - this.memsize - this.memsize = 0 - if (isString) this.memory = '' - } - - if (p <= bEnd - 32) - { - var limit = bEnd - 32 - - do - { - if (isString) { - var other - other = UINT64( - (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) - , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) - , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4) - , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6) - ) - this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - p += 8 - other = UINT64( - (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) - , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) - , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4) - , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6) - ) - this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - p += 8 - other = UINT64( - (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) - , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) - , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4) - , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6) - ) - this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - p += 8 - other = UINT64( - (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) - , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) - , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4) - , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6) - ) - this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - } else { - var other - other = UINT64( - (input[p+1] << 8) | input[p] - , (input[p+3] << 8) | input[p+2] - , (input[p+5] << 8) | input[p+4] - , (input[p+7] << 8) | input[p+6] - ) - this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - p += 8 - other = UINT64( - (input[p+1] << 8) | input[p] - , (input[p+3] << 8) | input[p+2] - , (input[p+5] << 8) | input[p+4] - , (input[p+7] << 8) | input[p+6] - ) - this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - p += 8 - other = UINT64( - (input[p+1] << 8) | input[p] - , (input[p+3] << 8) | input[p+2] - , (input[p+5] << 8) | input[p+4] - , (input[p+7] << 8) | input[p+6] - ) - this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - p += 8 - other = UINT64( - (input[p+1] << 8) | input[p] - , (input[p+3] << 8) | input[p+2] - , (input[p+5] << 8) | input[p+4] - , (input[p+7] << 8) | input[p+6] - ) - this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); - } p += 8 } while (p <= limit) } @@ -3965,9 +3866,7 @@ XXH64.prototype.update = function (input) { if (p < bEnd) { // XXH64_memcpy(this.memory, p, bEnd-p); - if (isString) { - this.memory += input.slice(p) - } else if (isArrayBuffer) { + if (isArrayBuffer) { this.memory.set( input.subarray(p, bEnd), this.memsize ) } else { input.copy( this.memory, this.memsize, p, bEnd ) @@ -3986,7 +3885,6 @@ XXH64.prototype.update = function (input) { */ XXH64.prototype.digest = function () { var input = this.memory - var isString = typeof input == 'string' var p = 0 var bEnd = this.memsize var h64, h @@ -4020,21 +3918,12 @@ XXH64.prototype.digest = function () { while (p <= bEnd - 8) { - if (isString) { - u.fromBits( - (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) - , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) - , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4) - , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6) - ) - } else { - u.fromBits( - (input[p+1] << 8) | input[p] - , (input[p+3] << 8) | input[p+2] - , (input[p+5] << 8) | input[p+4] - , (input[p+7] << 8) | input[p+6] + u.fromBits( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + , (input[p+5] << 8) | input[p+4] + , (input[p+7] << 8) | input[p+6] ) - } u.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1) h64 .xor(u) @@ -4045,21 +3934,12 @@ XXH64.prototype.digest = function () { } if (p + 4 <= bEnd) { - if (isString) { - u.fromBits( - (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) - , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) - , 0 - , 0 - ) - } else { - u.fromBits( - (input[p+1] << 8) | input[p] - , (input[p+3] << 8) | input[p+2] - , 0 - , 0 - ) - } + u.fromBits( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + , 0 + , 0 + ) h64 .xor( u.multiply(PRIME64_1) ) .rotl(23) @@ -4070,7 +3950,7 @@ XXH64.prototype.digest = function () { while (p < bEnd) { - u.fromBits( isString ? input.charCodeAt(p++) : input[p++], 0, 0, 0 ) + u.fromBits( input[p++], 0, 0, 0 ) h64 .xor( u.multiply(PRIME64_5) ) .rotl(11) diff --git a/build/xxhash.min.js b/build/xxhash.min.js index 71731c8..2e69759 100644 --- a/build/xxhash.min.js +++ b/build/xxhash.min.js @@ -1,3 +1,2 @@ -!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.XXH=r():t.XXH=r()}(this,function(){return function(t){function r(e){if(i[e])return i[e].exports;var o=i[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var i={};return r.m=t,r.c=i,r.d=function(t,i,e){r.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:e})},r.n=function(t){var i=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(i,"a",i),i},r.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},r.p="",r(r.s=2)}([function(t,r,i){"use strict";(function(t){function e(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}function o(){return n.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function h(t,r){if(o()t)throw new RangeError('"size" argument must not be negative')}function u(t,r,i,e){return a(r),0>=r?h(t,r):void 0!==i?"string"==typeof e?h(t,r).fill(i,e):h(t,r).fill(i):h(t,r)}function f(t,r){if(a(r),t=h(t,0>r?0:0|y(r)),!n.TYPED_ARRAY_SUPPORT)for(var i=0;r>i;++i)t[i]=0;return t}function l(t,r,i){if(("string"!=typeof i||""===i)&&(i="utf8"),!n.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var e=0|d(r,i);t=h(t,e);var o=t.write(r,i);return o!==e&&(t=t.slice(0,o)),t}function c(t,r){var i=r.length<0?0:0|y(r.length);t=h(t,i);for(var e=0;i>e;e+=1)t[e]=255&r[e];return t}function p(t,r,i,e){if(r.byteLength,0>i||r.byteLength=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function _(t){return+t!=t&&(t=0),n.alloc(+t)}function d(t,r){if(n.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return Z(t).length;default:if(e)return H(t).length;r=(""+r).toLowerCase(),e=!0}}function g(t,r,i){var e=!1;if((void 0===r||0>r)&&(r=0),r>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),0>=i)return"";if(i>>>=0,r>>>=0,r>=i)return"";for(t||(t="utf8");;)switch(t){case"hex":return z(this,r,i);case"utf8":case"utf-8":return P(this,r,i);case"ascii":return S(this,r,i);case"latin1":case"binary":return I(this,r,i);case"base64":return T(this,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,r,i);default:if(e)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),e=!0}}function w(t,r,i){var e=t[r];t[r]=t[i],t[i]=e}function v(t,r,i,e,o){if(0===t.length)return-1;if("string"==typeof i?(e=i,i=0):i>2147483647?i=2147483647:-2147483648>i&&(i=-2147483648),i=+i,isNaN(i)&&(i=o?0:t.length-1),0>i&&(i=t.length+i),i>=t.length){if(o)return-1;i=t.length-1}else if(0>i){if(!o)return-1;i=0}if("string"==typeof r&&(r=n.from(r,e)),n.isBuffer(r))return 0===r.length?-1:A(t,r,i,e,o);if("number"==typeof r)return r=255&r,n.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,i):Uint8Array.prototype.lastIndexOf.call(t,r,i):A(t,[r],i,e,o);throw new TypeError("val must be string, number or Buffer")}function A(t,r,i,e,o){function h(t,r){return 1===n?t[r]:t.readUInt16BE(r*n)}var n=1,s=t.length,a=r.length;if(void 0!==e&&(e=String(e).toLowerCase(),"ucs2"===e||"ucs-2"===e||"utf16le"===e||"utf-16le"===e)){if(t.length<2||r.length<2)return-1;n=2,s/=2,a/=2,i/=2}var u;if(o){var f=-1;for(u=i;s>u;u++)if(h(t,u)===h(r,-1===f?0:u-f)){if(-1===f&&(f=u),u-f+1===a)return f*n}else-1!==f&&(u-=u-f),f=-1}else for(i+a>s&&(i=s-a),u=i;u>=0;u--){for(var l=!0,c=0;a>c;c++)if(h(t,u+c)!==h(r,c)){l=!1;break}if(l)return u}return-1}function C(t,r,i,e){i=Number(i)||0;var o=t.length-i;e?(e=Number(e),e>o&&(e=o)):e=o;var h=r.length;if(h%2!==0)throw new TypeError("Invalid hex string");e>h/2&&(e=h/2);for(var n=0;e>n;++n){var s=parseInt(r.substr(2*n,2),16);if(isNaN(s))return n;t[i+n]=s}return n}function b(t,r,i,e){return G(H(r,t.length-i),t,i,e)}function E(t,r,i,e){return G(V(r),t,i,e)}function R(t,r,i,e){return E(t,r,i,e)}function x(t,r,i,e){return G(Z(r),t,i,e)}function B(t,r,i,e){return G(J(r,t.length-i),t,i,e)}function T(t,r,i){return Q.fromByteArray(0===r&&i===t.length?t:t.slice(r,i))}function P(t,r,i){i=Math.min(t.length,i);for(var e=[],o=r;i>o;){var h=t[o],n=null,s=h>239?4:h>223?3:h>191?2:1;if(i>=o+s){var a,u,f,l;switch(s){case 1:128>h&&(n=h);break;case 2:a=t[o+1],128===(192&a)&&(l=(31&h)<<6|63&a,l>127&&(n=l));break;case 3:a=t[o+1],u=t[o+2],128===(192&a)&&128===(192&u)&&(l=(15&h)<<12|(63&a)<<6|63&u,l>2047&&(55296>l||l>57343)&&(n=l));break;case 4:a=t[o+1],u=t[o+2],f=t[o+3],128===(192&a)&&128===(192&u)&&128===(192&f)&&(l=(15&h)<<18|(63&a)<<12|(63&u)<<6|63&f,l>65535&&1114112>l&&(n=l))}}null===n?(n=65533,s=1):n>65535&&(n-=65536,e.push(n>>>10&1023|55296),n=56320|1023&n),e.push(n),o+=s}return U(e)}function U(t){var r=t.length;if(tt>=r)return String.fromCharCode.apply(String,t);for(var i="",e=0;r>e;)i+=String.fromCharCode.apply(String,t.slice(e,e+=tt));return i}function S(t,r,i){var e="";i=Math.min(t.length,i);for(var o=r;i>o;++o)e+=String.fromCharCode(127&t[o]);return e}function I(t,r,i){var e="";i=Math.min(t.length,i);for(var o=r;i>o;++o)e+=String.fromCharCode(t[o]);return e}function z(t,r,i){var e=t.length;(!r||0>r)&&(r=0),(!i||0>i||i>e)&&(i=e);for(var o="",h=r;i>h;++h)o+=X(t[h]);return o}function Y(t,r,i){for(var e=t.slice(r,i),o="",h=0;ht)throw new RangeError("offset is not uint");if(t+r>i)throw new RangeError("Trying to access beyond buffer length")}function L(t,r,i,e,o,h){if(!n.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||h>r)throw new RangeError('"value" argument is out of bounds');if(i+e>t.length)throw new RangeError("Index out of range")}function O(t,r,i,e){0>r&&(r=65535+r+1);for(var o=0,h=Math.min(t.length-i,2);h>o;++o)t[i+o]=(r&255<<8*(e?o:1-o))>>>8*(e?o:1-o)}function N(t,r,i,e){0>r&&(r=4294967295+r+1);for(var o=0,h=Math.min(t.length-i,4);h>o;++o)t[i+o]=r>>>8*(e?o:3-o)&255}function D(t,r,i,e){if(i+e>t.length)throw new RangeError("Index out of range");if(0>i)throw new RangeError("Index out of range")}function k(t,r,i,e,o){return o||D(t,r,i,4,3.4028234663852886e38,-3.4028234663852886e38),W.write(t,r,i,e,23,4),i+4}function j(t,r,i,e,o){return o||D(t,r,i,8,1.7976931348623157e308,-1.7976931348623157e308),W.write(t,r,i,e,52,8),i+8}function F(t){if(t=q(t).replace(rt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function X(t){return 16>t?"0"+t.toString(16):t.toString(16)}function H(t,r){r=r||1/0;for(var i,e=t.length,o=null,h=[],n=0;e>n;++n){if(i=t.charCodeAt(n),i>55295&&57344>i){if(!o){if(i>56319){(r-=3)>-1&&h.push(239,191,189);continue}if(n+1===e){(r-=3)>-1&&h.push(239,191,189);continue}o=i;continue}if(56320>i){(r-=3)>-1&&h.push(239,191,189),o=i;continue}i=(o-55296<<10|i-56320)+65536}else o&&(r-=3)>-1&&h.push(239,191,189);if(o=null,128>i){if((r-=1)<0)break;h.push(i)}else if(2048>i){if((r-=2)<0)break;h.push(i>>6|192,63&i|128)}else if(65536>i){if((r-=3)<0)break;h.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(1114112>i))throw new Error("Invalid code point");if((r-=4)<0)break;h.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return h}function V(t){for(var r=[],i=0;i>8,o=i%256,h.push(o),h.push(e);return h}function Z(t){return Q.toByteArray(F(t))}function G(t,r,i,e){for(var o=0;e>o&&!(o+i>=r.length||o>=t.length);++o)r[o+i]=t[o];return o}function K(t){return t!==t}var Q=i(5),W=i(6),$=i(7);r.Buffer=n,r.SlowBuffer=_,r.INSPECT_MAX_BYTES=50,n.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:e(),r.kMaxLength=o(),n.poolSize=8192,n._augment=function(t){return t.__proto__=n.prototype,t},n.from=function(t,r,i){return s(null,t,r,i)},n.TYPED_ARRAY_SUPPORT&&(n.prototype.__proto__=Uint8Array.prototype,n.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&n[Symbol.species]===n&&Object.defineProperty(n,Symbol.species,{value:null,configurable:!0})),n.alloc=function(t,r,i){return u(null,t,r,i)},n.allocUnsafe=function(t){return f(null,t)},n.allocUnsafeSlow=function(t){return f(null,t)},n.isBuffer=function(t){return!(null==t||!t._isBuffer)},n.compare=function(t,r){if(!n.isBuffer(t)||!n.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var i=t.length,e=r.length,o=0,h=Math.min(i,e);h>o;++o)if(t[o]!==r[o]){i=t[o],e=r[o];break}return e>i?-1:i>e?1:0},n.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},n.concat=function(t,r){if(!$(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return n.alloc(0);var i;if(void 0===r)for(r=0,i=0;ir;r+=2)w(this,r,r+1);return this},n.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;t>r;r+=4)w(this,r,r+3),w(this,r+1,r+2);return this},n.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;t>r;r+=8)w(this,r,r+7),w(this,r+1,r+6),w(this,r+2,r+5),w(this,r+3,r+4);return this},n.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?P(this,0,t):g.apply(this,arguments)},n.prototype.equals=function(t){if(!n.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:0===n.compare(this,t)},n.prototype.inspect=function(){var t="",i=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),""},n.prototype.compare=function(t,r,i,e,o){if(!n.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===i&&(i=t?t.length:0),void 0===e&&(e=0),void 0===o&&(o=this.length),0>r||i>t.length||0>e||o>this.length)throw new RangeError("out of range index");if(e>=o&&r>=i)return 0;if(e>=o)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,e>>>=0,o>>>=0,this===t)return 0;for(var h=o-e,s=i-r,a=Math.min(h,s),u=this.slice(e,o),f=t.slice(r,i),l=0;a>l;++l)if(u[l]!==f[l]){h=u[l],s=f[l];break}return s>h?-1:h>s?1:0},n.prototype.includes=function(t,r,i){return-1!==this.indexOf(t,r,i)},n.prototype.indexOf=function(t,r,i){return v(this,t,r,i,!0)},n.prototype.lastIndexOf=function(t,r,i){return v(this,t,r,i,!1)},n.prototype.write=function(t,r,i,e){if(void 0===r)e="utf8",i=this.length,r=0;else if(void 0===i&&"string"==typeof r)e=r,i=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r=0|r,isFinite(i)?(i=0|i,void 0===e&&(e="utf8")):(e=i,i=void 0)}var o=this.length-r;if((void 0===i||i>o)&&(i=o),t.length>0&&(0>i||0>r)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");for(var h=!1;;)switch(e){case"hex":return C(this,t,r,i);case"utf8":case"utf-8":return b(this,t,r,i);case"ascii":return E(this,t,r,i);case"latin1":case"binary":return R(this,t,r,i);case"base64":return x(this,t,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r,i);default:if(h)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),h=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;n.prototype.slice=function(t,r){var i=this.length;t=~~t,r=void 0===r?i:~~r,0>t?(t+=i,0>t&&(t=0)):t>i&&(t=i),0>r?(r+=i,0>r&&(r=0)):r>i&&(r=i),t>r&&(r=t);var e;if(n.TYPED_ARRAY_SUPPORT)e=this.subarray(t,r),e.__proto__=n.prototype;else{var o=r-t;e=new n(o,void 0);for(var h=0;o>h;++h)e[h]=this[h+t]}return e},n.prototype.readUIntLE=function(t,r,i){t=0|t,r=0|r,i||M(t,r,this.length);for(var e=this[t],o=1,h=0;++h0&&(o*=256);)e+=this[t+--r]*o;return e},n.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},n.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},n.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},n.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},n.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},n.prototype.readIntLE=function(t,r,i){t=0|t,r=0|r,i||M(t,r,this.length);for(var e=this[t],o=1,h=0;++h=o&&(e-=Math.pow(2,8*r)),e},n.prototype.readIntBE=function(t,r,i){t=0|t,r=0|r,i||M(t,r,this.length);for(var e=r,o=1,h=this[t+--e];e>0&&(o*=256);)h+=this[t+--e]*o;return o*=128,h>=o&&(h-=Math.pow(2,8*r)),h},n.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},n.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},n.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},n.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},n.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},n.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),W.read(this,t,!0,23,4)},n.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),W.read(this,t,!1,23,4)},n.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),W.read(this,t,!0,52,8)},n.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),W.read(this,t,!1,52,8)},n.prototype.writeUIntLE=function(t,r,i,e){if(t=+t,r=0|r,i=0|i,!e){var o=Math.pow(2,8*i)-1;L(this,t,r,i,o,0)}var h=1,n=0;for(this[r]=255&t;++n=0&&(n*=256);)this[r+h]=t/n&255;return r+i},n.prototype.writeUInt8=function(t,r,i){return t=+t,r=0|r,i||L(this,t,r,1,255,0),n.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},n.prototype.writeUInt16LE=function(t,r,i){return t=+t,r=0|r,i||L(this,t,r,2,65535,0),n.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):O(this,t,r,!0),r+2},n.prototype.writeUInt16BE=function(t,r,i){return t=+t,r=0|r,i||L(this,t,r,2,65535,0),n.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):O(this,t,r,!1),r+2},n.prototype.writeUInt32LE=function(t,r,i){return t=+t,r=0|r,i||L(this,t,r,4,4294967295,0),n.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):N(this,t,r,!0),r+4},n.prototype.writeUInt32BE=function(t,r,i){return t=+t,r=0|r,i||L(this,t,r,4,4294967295,0),n.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):N(this,t,r,!1),r+4},n.prototype.writeIntLE=function(t,r,i,e){if(t=+t,r=0|r,!e){var o=Math.pow(2,8*i-1);L(this,t,r,i,o-1,-o)}var h=0,n=1,s=0;for(this[r]=255&t;++ht&&0===s&&0!==this[r+h-1]&&(s=1),this[r+h]=(t/n>>0)-s&255;return r+i},n.prototype.writeIntBE=function(t,r,i,e){if(t=+t,r=0|r,!e){var o=Math.pow(2,8*i-1);L(this,t,r,i,o-1,-o)}var h=i-1,n=1,s=0;for(this[r+h]=255&t;--h>=0&&(n*=256);)0>t&&0===s&&0!==this[r+h+1]&&(s=1),this[r+h]=(t/n>>0)-s&255;return r+i},n.prototype.writeInt8=function(t,r,i){return t=+t,r=0|r,i||L(this,t,r,1,127,-128),n.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[r]=255&t,r+1},n.prototype.writeInt16LE=function(t,r,i){return t=+t,r=0|r,i||L(this,t,r,2,32767,-32768),n.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):O(this,t,r,!0),r+2},n.prototype.writeInt16BE=function(t,r,i){return t=+t,r=0|r,i||L(this,t,r,2,32767,-32768),n.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):O(this,t,r,!1),r+2},n.prototype.writeInt32LE=function(t,r,i){return t=+t,r=0|r,i||L(this,t,r,4,2147483647,-2147483648),n.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):N(this,t,r,!0),r+4},n.prototype.writeInt32BE=function(t,r,i){return t=+t,r=0|r,i||L(this,t,r,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),n.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):N(this,t,r,!1),r+4},n.prototype.writeFloatLE=function(t,r,i){return k(this,t,r,!0,i)},n.prototype.writeFloatBE=function(t,r,i){return k(this,t,r,!1,i)},n.prototype.writeDoubleLE=function(t,r,i){return j(this,t,r,!0,i)},n.prototype.writeDoubleBE=function(t,r,i){return j(this,t,r,!1,i)},n.prototype.copy=function(t,r,i,e){if(i||(i=0),e||0===e||(e=this.length),r>=t.length&&(r=t.length),r||(r=0),e>0&&i>e&&(e=i),e===i)return 0;if(0===t.length||0===this.length)return 0;if(0>r)throw new RangeError("targetStart out of bounds");if(0>i||i>=this.length)throw new RangeError("sourceStart out of bounds");if(0>e)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),t.length-ri&&e>r)for(o=h-1;o>=0;--o)t[o+r]=this[o+i];else if(1e3>h||!n.TYPED_ARRAY_SUPPORT)for(o=0;h>o;++o)t[o+r]=this[o+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+h),r);return h},n.prototype.fill=function(t,r,i,e){if("string"==typeof t){if("string"==typeof r?(e=r,r=0,i=this.length):"string"==typeof i&&(e=i,i=this.length),1===t.length){var o=t.charCodeAt(0);256>o&&(t=o)}if(void 0!==e&&"string"!=typeof e)throw new TypeError("encoding must be a string");if("string"==typeof e&&!n.isEncoding(e))throw new TypeError("Unknown encoding: "+e)}else"number"==typeof t&&(t=255&t);if(0>r||this.length=i)return this;r>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0);var h;if("number"==typeof t)for(h=r;i>h;++h)this[h]=t;else{var s=n.isBuffer(t)?t:H(new n(t,e).toString()),a=s.length;for(h=0;i-r>h;++h)this[h+r]=s[h%a]}return this};var rt=/[^+\/0-9A-Za-z-_]/g}).call(r,i(4))},function(t,r,i){r.UINT32=i(8),r.UINT64=i(9)},function(t,r,i){t.exports={h32:i(3),h64:i(10)}},function(t,r,i){(function(r){function e(t){for(var r=[],i=0,e=t.length;e>i;i++){var o=t.charCodeAt(i);128>o?r.push(o):2048>o?r.push(192|o>>6,128|63&o):55296>o||o>=57344?r.push(224|o>>12,128|o>>6&63,128|63&o):(i++,o=65536+((1023&o)<<10|1023&t.charCodeAt(i)),r.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|63&o))}return new Uint8Array(r)}function o(){return 2==arguments.length?new o(arguments[1]).update(arguments[0]).digest():this instanceof o?void h.call(this,arguments[0]):new o(arguments[0])}function h(t){return this.seed=t instanceof n?t.clone():n(t),this.v1=this.seed.clone().add(s).add(a),this.v2=this.seed.clone().add(a),this.v3=this.seed.clone(),this.v4=this.seed.clone().subtract(s),this.total_len=0,this.memsize=0,this.memory=null,this}var n=i(1).UINT32;n.prototype.xxh_update=function(t,r){var i,e,o=a._low,h=a._high;e=t*o,i=e>>>16,i+=r*o,i&=65535,i+=t*h;var n=this._low+(65535&e),u=n>>>16;u+=this._high+(65535&i);var f=u<<16|65535&n;f=f<<13|f>>>19,n=65535&f,u=f>>>16,o=s._low,h=s._high,e=n*o,i=e>>>16,i+=u*o,i&=65535,i+=n*h,this._low=65535&e,this._high=65535&i};var s=n("2654435761"),a=n("2246822519"),u=n("3266489917"),f=n("668265263"),l=n("374761393");o.prototype.init=h,o.prototype.update=function(t){var i,o="string"==typeof t;o&&(t=e(t),o=!1,i=!0),"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer&&(i=!0,t=new Uint8Array(t));var h=0,n=t.length,s=h+n;if(0==n)return this;if(this.total_len+=n,0==this.memsize&&(this.memory=o?"":i?new Uint8Array(16):new r(16)),this.memsize+n<16)return o?this.memory+=t:i?this.memory.set(t.subarray(0,n),this.memsize):t.copy(this.memory,this.memsize,0,n),this.memsize+=n,this;if(this.memsize>0){o?this.memory+=t.slice(0,16-this.memsize):i?this.memory.set(t.subarray(0,16-this.memsize),this.memsize):t.copy(this.memory,this.memsize,0,16-this.memsize);var a=0;o?(this.v1.xxh_update(this.memory.charCodeAt(a+1)<<8|this.memory.charCodeAt(a),this.memory.charCodeAt(a+3)<<8|this.memory.charCodeAt(a+2)),a+=4,this.v2.xxh_update(this.memory.charCodeAt(a+1)<<8|this.memory.charCodeAt(a),this.memory.charCodeAt(a+3)<<8|this.memory.charCodeAt(a+2)),a+=4,this.v3.xxh_update(this.memory.charCodeAt(a+1)<<8|this.memory.charCodeAt(a),this.memory.charCodeAt(a+3)<<8|this.memory.charCodeAt(a+2)),a+=4,this.v4.xxh_update(this.memory.charCodeAt(a+1)<<8|this.memory.charCodeAt(a),this.memory.charCodeAt(a+3)<<8|this.memory.charCodeAt(a+2))):(this.v1.xxh_update(this.memory[a+1]<<8|this.memory[a],this.memory[a+3]<<8|this.memory[a+2]),a+=4,this.v2.xxh_update(this.memory[a+1]<<8|this.memory[a],this.memory[a+3]<<8|this.memory[a+2]),a+=4,this.v3.xxh_update(this.memory[a+1]<<8|this.memory[a],this.memory[a+3]<<8|this.memory[a+2]),a+=4,this.v4.xxh_update(this.memory[a+1]<<8|this.memory[a],this.memory[a+3]<<8|this.memory[a+2])),h+=16-this.memsize,this.memsize=0,o&&(this.memory="")}if(s-16>=h){var u=s-16;do o?(this.v1.xxh_update(t.charCodeAt(h+1)<<8|t.charCodeAt(h),t.charCodeAt(h+3)<<8|t.charCodeAt(h+2)),h+=4,this.v2.xxh_update(t.charCodeAt(h+1)<<8|t.charCodeAt(h),t.charCodeAt(h+3)<<8|t.charCodeAt(h+2)),h+=4,this.v3.xxh_update(t.charCodeAt(h+1)<<8|t.charCodeAt(h),t.charCodeAt(h+3)<<8|t.charCodeAt(h+2)),h+=4,this.v4.xxh_update(t.charCodeAt(h+1)<<8|t.charCodeAt(h),t.charCodeAt(h+3)<<8|t.charCodeAt(h+2))):(this.v1.xxh_update(t[h+1]<<8|t[h],t[h+3]<<8|t[h+2]),h+=4,this.v2.xxh_update(t[h+1]<<8|t[h],t[h+3]<<8|t[h+2]),h+=4,this.v3.xxh_update(t[h+1]<<8|t[h],t[h+3]<<8|t[h+2]),h+=4,this.v4.xxh_update(t[h+1]<<8|t[h],t[h+3]<<8|t[h+2])),h+=4;while(u>=h)}return s>h&&(o?this.memory+=t.slice(h):i?this.memory.set(t.subarray(h,s),this.memsize):t.copy(this.memory,this.memsize,h,s),this.memsize=s-h),this},o.prototype.digest=function(){var t,r,i=this.memory,e="string"==typeof i,o=0,h=this.memsize,c=new n;for(t=this.total_len>=16?this.v1.rotl(1).add(this.v2.rotl(7).add(this.v3.rotl(12).add(this.v4.rotl(18)))):this.seed.clone().add(l),t.add(c.fromNumber(this.total_len));h-4>=o;)e?c.fromBits(i.charCodeAt(o+1)<<8|i.charCodeAt(o),i.charCodeAt(o+3)<<8|i.charCodeAt(o+2)):c.fromBits(i[o+1]<<8|i[o],i[o+3]<<8|i[o+2]),t.add(c.multiply(u)).rotl(17).multiply(f),o+=4;for(;h>o;)c.fromBits(e?i.charCodeAt(o++):i[o++],0),t.add(c.multiply(l)).rotl(11).multiply(s);return r=t.clone().shiftRight(15),t.xor(r).multiply(a),r=t.clone().shiftRight(13),t.xor(r).multiply(u),r=t.clone().shiftRight(16),t.xor(r),this.init(this.seed),t},t.exports=o}).call(r,i(0).Buffer)},function(t){var r;r=function(){return this}();try{r=r||Function("return this")()||(1,eval)("this")}catch(i){"object"==typeof window&&(r=window)}t.exports=r},function(t,r){"use strict";function i(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[r-2]?2:"="===t[r-1]?1:0}function e(t){return 3*t.length/4-i(t)}function o(t){var r,e,o,h,n,s=t.length;h=i(t),n=new f(3*s/4-h),e=h>0?s-4:s;var a=0;for(r=0;e>r;r+=4)o=u[t.charCodeAt(r)]<<18|u[t.charCodeAt(r+1)]<<12|u[t.charCodeAt(r+2)]<<6|u[t.charCodeAt(r+3)],n[a++]=o>>16&255,n[a++]=o>>8&255,n[a++]=255&o;return 2===h?(o=u[t.charCodeAt(r)]<<2|u[t.charCodeAt(r+1)]>>4,n[a++]=255&o):1===h&&(o=u[t.charCodeAt(r)]<<10|u[t.charCodeAt(r+1)]<<4|u[t.charCodeAt(r+2)]>>2,n[a++]=o>>8&255,n[a++]=255&o),n}function h(t){return a[t>>18&63]+a[t>>12&63]+a[t>>6&63]+a[63&t]}function n(t,r,i){for(var e,o=[],n=r;i>n;n+=3)e=(t[n]<<16)+(t[n+1]<<8)+t[n+2],o.push(h(e));return o.join("")}function s(t){for(var r,i=t.length,e=i%3,o="",h=[],s=16383,u=0,f=i-e;f>u;u+=s)h.push(n(t,u,u+s>f?f:u+s));return 1===e?(r=t[i-1],o+=a[r>>2],o+=a[r<<4&63],o+="=="):2===e&&(r=(t[i-2]<<8)+t[i-1],o+=a[r>>10],o+=a[r>>4&63],o+=a[r<<2&63],o+="="),h.push(o),h.join("")}r.byteLength=e,r.toByteArray=o,r.fromByteArray=s;for(var a=[],u=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,p=l.length;p>c;++c)a[c]=l[c],u[l.charCodeAt(c)]=c;u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},function(t,r){r.read=function(t,r,i,e,o){var h,n,s=8*o-e-1,a=(1<>1,f=-7,l=i?o-1:0,c=i?-1:1,p=t[r+l];for(l+=c,h=p&(1<<-f)-1,p>>=-f,f+=s;f>0;h=256*h+t[r+l],l+=c,f-=8);for(n=h&(1<<-f)-1,h>>=-f,f+=e;f>0;n=256*n+t[r+l],l+=c,f-=8);if(0===h)h=1-u;else{if(h===a)return n?0/0:(p?-1:1)*(1/0);n+=Math.pow(2,e),h-=u}return(p?-1:1)*n*Math.pow(2,h-e)},r.write=function(t,r,i,e,o,h){var n,s,a,u=8*h-o-1,f=(1<>1,c=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=e?0:h-1,m=e?1:-1,y=0>r||0===r&&0>1/r?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,n=f):(n=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-n))<1&&(n--,a*=2),r+=n+l>=1?c/a:c*Math.pow(2,1-l),r*a>=2&&(n++,a/=2),n+l>=f?(s=0,n=f):n+l>=1?(s=(r*a-1)*Math.pow(2,o),n+=l):(s=r*Math.pow(2,l-1)*Math.pow(2,o),n=0));o>=8;t[i+p]=255&s,p+=m,s/=256,o-=8);for(n=n<0;t[i+p]=255&n,p+=m,n/=256,u-=8);t[i+p-m]|=128*y}},function(t){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,r){var i,e;!function(o){function h(t,r){return this instanceof h?(this._low=0,this._high=0,this.remainder=null,"undefined"==typeof r?s.call(this,t):"string"==typeof t?a.call(this,t,r):void n.call(this,t,r)):new h(t,r)}function n(t,r){return this._low=0|t,this._high=0|r,this}function s(t){return this._low=65535&t,this._high=t>>>16,this}function a(t,r){var i=parseInt(t,r||10);return this._low=65535&i,this._high=i>>>16,this}({36:h(Math.pow(36,5)),16:h(Math.pow(16,7)),10:h(Math.pow(10,9)),2:h(Math.pow(2,30))}),{36:h(36),16:h(16),10:h(10),2:h(2)};h.prototype.fromBits=n,h.prototype.fromNumber=s,h.prototype.fromString=a,h.prototype.toNumber=function(){return 65536*this._high+this._low},h.prototype.toString=function(t){return this.toNumber().toString(t||10)},h.prototype.add=function(t){var r=this._low+t._low,i=r>>>16;return i+=this._high+t._high,this._low=65535&r,this._high=65535&i,this},h.prototype.subtract=function(t){return this.add(t.clone().negate())},h.prototype.multiply=function(t){var r,i,e=this._high,o=this._low,h=t._high,n=t._low;return i=o*n,r=i>>>16,r+=e*n,r&=65535,r+=o*h,this._low=65535&i,this._high=65535&r,this},h.prototype.div=function(t){if(0==t._low&&0==t._high)throw Error("division by zero");if(0==t._high&&1==t._low)return this.remainder=new h(0),this;if(t.gt(this))return this.remainder=this.clone(),this._low=0,this._high=0,this;if(this.eq(t))return this.remainder=new h(0),this._low=1,this._high=0,this;for(var r=t.clone(),i=-1;!this.lt(r);)r.shiftLeft(1,!0),i++;for(this.remainder=this.clone(),this._low=0,this._high=0;i>=0;i--)r.shiftRight(1),this.remainder.lt(r)||(this.remainder.subtract(r),i>=16?this._high|=1<>>16)&65535,this},h.prototype.equals=h.prototype.eq=function(t){return this._low==t._low&&this._high==t._high},h.prototype.greaterThan=h.prototype.gt=function(t){return this._high>t._high?!0:this._hight._low},h.prototype.lessThan=h.prototype.lt=function(t){return this._hight._high?!1:this._low16?(this._low=this._high>>t-16,this._high=0):16==t?(this._low=this._high,this._high=0):(this._low=this._low>>t|this._high<<16-t&65535,this._high>>=t),this},h.prototype.shiftLeft=h.prototype.shiftl=function(t,r){return t>16?(this._high=this._low<>16-t,this._low=this._low<>>32-t,this._low=65535&r,this._high=r>>>16,this},h.prototype.rotateRight=h.prototype.rotr=function(t){var r=this._high<<16|this._low;return r=r>>>t|r<<32-t,this._low=65535&r,this._high=r>>>16,this},h.prototype.clone=function(){return new h(this._low,this._high)},i=[],e=function(){return h}.apply(r,i),!(void 0!==e&&(t.exports=e))}(this)},function(t,r){var i,e;!function(o){function h(t,r,i,e){return this instanceof h?(this.remainder=null,"string"==typeof t?a.call(this,t,r):"undefined"==typeof r?s.call(this,t):void n.apply(this,arguments)):new h(t,r,i,e)}function n(t,r,i,e){return"undefined"==typeof i?(this._a00=65535&t,this._a16=t>>>16,this._a32=65535&r,this._a48=r>>>16,this):(this._a00=0|t,this._a16=0|r,this._a32=0|i,this._a48=0|e,this)}function s(t){return this._a00=65535&t,this._a16=t>>>16,this._a32=0,this._a48=0,this}function a(t,r){r=r||10,this._a00=0,this._a16=0,this._a32=0,this._a48=0;for(var i=u[r]||new h(Math.pow(r,5)),e=0,o=t.length;o>e;e+=5){var n=Math.min(5,o-e),s=parseInt(t.slice(e,e+n),r);this.multiply(5>n?new h(Math.pow(r,n)):i).add(new h(s))}return this}var u={16:h(Math.pow(16,5)),10:h(Math.pow(10,5)),2:h(Math.pow(2,5))},f={16:h(16),10:h(10),2:h(2)};h.prototype.fromBits=n,h.prototype.fromNumber=s,h.prototype.fromString=a,h.prototype.toNumber=function(){return 65536*this._a16+this._a00},h.prototype.toString=function(t){t=t||10; - -var r=f[t]||new h(t);if(!this.gt(r))return this.toNumber().toString(t);for(var i=this.clone(),e=new Array(64),o=63;o>=0&&(i.div(r),e[o]=i.remainder.toNumber().toString(t),i.gt(r));o--);return e[o-1]=i.toNumber().toString(t),e.join("")},h.prototype.add=function(t){var r=this._a00+t._a00,i=r>>>16;i+=this._a16+t._a16;var e=i>>>16;e+=this._a32+t._a32;var o=e>>>16;return o+=this._a48+t._a48,this._a00=65535&r,this._a16=65535&i,this._a32=65535&e,this._a48=65535&o,this},h.prototype.subtract=function(t){return this.add(t.clone().negate())},h.prototype.multiply=function(t){var r=this._a00,i=this._a16,e=this._a32,o=this._a48,h=t._a00,n=t._a16,s=t._a32,a=t._a48,u=r*h,f=u>>>16;f+=r*n;var l=f>>>16;f&=65535,f+=i*h,l+=f>>>16,l+=r*s;var c=l>>>16;return l&=65535,l+=i*n,c+=l>>>16,l&=65535,l+=e*h,c+=l>>>16,c+=r*a,c&=65535,c+=i*s,c&=65535,c+=e*n,c&=65535,c+=o*h,this._a00=65535&u,this._a16=65535&f,this._a32=65535&l,this._a48=65535&c,this},h.prototype.div=function(t){if(0==t._a16&&0==t._a32&&0==t._a48){if(0==t._a00)throw Error("division by zero");if(1==t._a00)return this.remainder=new h(0),this}if(t.gt(this))return this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0,this;if(this.eq(t))return this.remainder=new h(0),this._a00=1,this._a16=0,this._a32=0,this._a48=0,this;for(var r=t.clone(),i=-1;!this.lt(r);)r.shiftLeft(1,!0),i++;for(this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0;i>=0;i--)r.shiftRight(1),this.remainder.lt(r)||(this.remainder.subtract(r),i>=48?this._a48|=1<=32?this._a32|=1<=16?this._a16|=1<>>16),this._a16=65535&t,t=(65535&~this._a32)+(t>>>16),this._a32=65535&t,this._a48=~this._a48+(t>>>16)&65535,this},h.prototype.equals=h.prototype.eq=function(t){return this._a48==t._a48&&this._a00==t._a00&&this._a32==t._a32&&this._a16==t._a16},h.prototype.greaterThan=h.prototype.gt=function(t){return this._a48>t._a48?!0:this._a48t._a32?!0:this._a32t._a16?!0:this._a16t._a00},h.prototype.lessThan=h.prototype.lt=function(t){return this._a48t._a48?!1:this._a32t._a32?!1:this._a16t._a16?!1:this._a00=48?(this._a00=this._a48>>t-48,this._a16=0,this._a32=0,this._a48=0):t>=32?(t-=32,this._a00=65535&(this._a32>>t|this._a48<<16-t),this._a16=this._a48>>t&65535,this._a32=0,this._a48=0):t>=16?(t-=16,this._a00=65535&(this._a16>>t|this._a32<<16-t),this._a16=65535&(this._a32>>t|this._a48<<16-t),this._a32=this._a48>>t&65535,this._a48=0):(this._a00=65535&(this._a00>>t|this._a16<<16-t),this._a16=65535&(this._a16>>t|this._a32<<16-t),this._a32=65535&(this._a32>>t|this._a48<<16-t),this._a48=this._a48>>t&65535),this},h.prototype.shiftLeft=h.prototype.shiftl=function(t,r){return t%=64,t>=48?(this._a48=this._a00<=32?(t-=32,this._a48=this._a16<>16-t,this._a32=this._a00<=16?(t-=16,this._a48=this._a32<>16-t,this._a32=65535&(this._a16<>16-t),this._a16=this._a00<>16-t,this._a32=65535&(this._a32<>16-t),this._a16=65535&(this._a16<>16-t),this._a00=this._a00<=32){var r=this._a00;if(this._a00=this._a32,this._a32=r,r=this._a48,this._a48=this._a16,this._a16=r,32==t)return this;t-=32}var i=this._a48<<16|this._a32,e=this._a16<<16|this._a00,o=i<>>32-t,h=e<>>32-t;return this._a00=65535&h,this._a16=h>>>16,this._a32=65535&o,this._a48=o>>>16,this},h.prototype.rotateRight=h.prototype.rotr=function(t){if(t%=64,0==t)return this;if(t>=32){var r=this._a00;if(this._a00=this._a32,this._a32=r,r=this._a48,this._a48=this._a16,this._a16=r,32==t)return this;t-=32}var i=this._a48<<16|this._a32,e=this._a16<<16|this._a00,o=i>>>t|e<<32-t,h=e>>>t|i<<32-t;return this._a00=65535&h,this._a16=h>>>16,this._a32=65535&o,this._a48=o>>>16,this},h.prototype.clone=function(){return new h(this._a00,this._a16,this._a32,this._a48)},i=[],e=function(){return h}.apply(r,i),!(void 0!==e&&(t.exports=e))}(this)},function(t,r,i){(function(r){function e(t){for(var r=[],i=0,e=t.length;e>i;i++){var o=t.charCodeAt(i);128>o?r.push(o):2048>o?r.push(192|o>>6,128|63&o):55296>o||o>=57344?r.push(224|o>>12,128|o>>6&63,128|63&o):(i++,o=65536+((1023&o)<<10|1023&t.charCodeAt(i)),r.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|63&o))}return new Uint8Array(r)}function o(){return 2==arguments.length?new o(arguments[1]).update(arguments[0]).digest():this instanceof o?void h.call(this,arguments[0]):new o(arguments[0])}function h(t){return this.seed=t instanceof n?t.clone():n(t),this.v1=this.seed.clone().add(s).add(a),this.v2=this.seed.clone().add(a),this.v3=this.seed.clone(),this.v4=this.seed.clone().subtract(s),this.total_len=0,this.memsize=0,this.memory=null,this}var n=i(1).UINT64,s=n("11400714785074694791"),a=n("14029467366897019727"),u=n("1609587929392839161"),f=n("9650029242287828579"),l=n("2870177450012600261");o.prototype.init=h,o.prototype.update=function(t){var i,o="string"==typeof t;o&&(t=e(t),o=!1,i=!0),"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer&&(i=!0,t=new Uint8Array(t));var h=0,u=t.length,f=h+u;if(0==u)return this;if(this.total_len+=u,0==this.memsize&&(this.memory=o?"":i?new Uint8Array(32):new r(32)),this.memsize+u<32)return o?this.memory+=t:i?this.memory.set(t.subarray(0,u),this.memsize):t.copy(this.memory,this.memsize,0,u),this.memsize+=u,this;if(this.memsize>0){o?this.memory+=t.slice(0,32-this.memsize):i?this.memory.set(t.subarray(0,32-this.memsize),this.memsize):t.copy(this.memory,this.memsize,0,32-this.memsize);var l=0;if(o){var c;c=n(this.memory.charCodeAt(l+1)<<8|this.memory.charCodeAt(l),this.memory.charCodeAt(l+3)<<8|this.memory.charCodeAt(l+2),this.memory.charCodeAt(l+5)<<8|this.memory.charCodeAt(l+4),this.memory.charCodeAt(l+7)<<8|this.memory.charCodeAt(l+6)),this.v1.add(c.multiply(a)).rotl(31).multiply(s),l+=8,c=n(this.memory.charCodeAt(l+1)<<8|this.memory.charCodeAt(l),this.memory.charCodeAt(l+3)<<8|this.memory.charCodeAt(l+2),this.memory.charCodeAt(l+5)<<8|this.memory.charCodeAt(l+4),this.memory.charCodeAt(l+7)<<8|this.memory.charCodeAt(l+6)),this.v2.add(c.multiply(a)).rotl(31).multiply(s),l+=8,c=n(this.memory.charCodeAt(l+1)<<8|this.memory.charCodeAt(l),this.memory.charCodeAt(l+3)<<8|this.memory.charCodeAt(l+2),this.memory.charCodeAt(l+5)<<8|this.memory.charCodeAt(l+4),this.memory.charCodeAt(l+7)<<8|this.memory.charCodeAt(l+6)),this.v3.add(c.multiply(a)).rotl(31).multiply(s),l+=8,c=n(this.memory.charCodeAt(l+1)<<8|this.memory.charCodeAt(l),this.memory.charCodeAt(l+3)<<8|this.memory.charCodeAt(l+2),this.memory.charCodeAt(l+5)<<8|this.memory.charCodeAt(l+4),this.memory.charCodeAt(l+7)<<8|this.memory.charCodeAt(l+6)),this.v4.add(c.multiply(a)).rotl(31).multiply(s)}else{var c;c=n(this.memory[l+1]<<8|this.memory[l],this.memory[l+3]<<8|this.memory[l+2],this.memory[l+5]<<8|this.memory[l+4],this.memory[l+7]<<8|this.memory[l+6]),this.v1.add(c.multiply(a)).rotl(31).multiply(s),l+=8,c=n(this.memory[l+1]<<8|this.memory[l],this.memory[l+3]<<8|this.memory[l+2],this.memory[l+5]<<8|this.memory[l+4],this.memory[l+7]<<8|this.memory[l+6]),this.v2.add(c.multiply(a)).rotl(31).multiply(s),l+=8,c=n(this.memory[l+1]<<8|this.memory[l],this.memory[l+3]<<8|this.memory[l+2],this.memory[l+5]<<8|this.memory[l+4],this.memory[l+7]<<8|this.memory[l+6]),this.v3.add(c.multiply(a)).rotl(31).multiply(s),l+=8,c=n(this.memory[l+1]<<8|this.memory[l],this.memory[l+3]<<8|this.memory[l+2],this.memory[l+5]<<8|this.memory[l+4],this.memory[l+7]<<8|this.memory[l+6]),this.v4.add(c.multiply(a)).rotl(31).multiply(s)}h+=32-this.memsize,this.memsize=0,o&&(this.memory="")}if(f-32>=h){var p=f-32;do{if(o){var c;c=n(t.charCodeAt(h+1)<<8|t.charCodeAt(h),t.charCodeAt(h+3)<<8|t.charCodeAt(h+2),t.charCodeAt(h+5)<<8|t.charCodeAt(h+4),t.charCodeAt(h+7)<<8|t.charCodeAt(h+6)),this.v1.add(c.multiply(a)).rotl(31).multiply(s),h+=8,c=n(t.charCodeAt(h+1)<<8|t.charCodeAt(h),t.charCodeAt(h+3)<<8|t.charCodeAt(h+2),t.charCodeAt(h+5)<<8|t.charCodeAt(h+4),t.charCodeAt(h+7)<<8|t.charCodeAt(h+6)),this.v2.add(c.multiply(a)).rotl(31).multiply(s),h+=8,c=n(t.charCodeAt(h+1)<<8|t.charCodeAt(h),t.charCodeAt(h+3)<<8|t.charCodeAt(h+2),t.charCodeAt(h+5)<<8|t.charCodeAt(h+4),t.charCodeAt(h+7)<<8|t.charCodeAt(h+6)),this.v3.add(c.multiply(a)).rotl(31).multiply(s),h+=8,c=n(t.charCodeAt(h+1)<<8|t.charCodeAt(h),t.charCodeAt(h+3)<<8|t.charCodeAt(h+2),t.charCodeAt(h+5)<<8|t.charCodeAt(h+4),t.charCodeAt(h+7)<<8|t.charCodeAt(h+6)),this.v4.add(c.multiply(a)).rotl(31).multiply(s)}else{var c;c=n(t[h+1]<<8|t[h],t[h+3]<<8|t[h+2],t[h+5]<<8|t[h+4],t[h+7]<<8|t[h+6]),this.v1.add(c.multiply(a)).rotl(31).multiply(s),h+=8,c=n(t[h+1]<<8|t[h],t[h+3]<<8|t[h+2],t[h+5]<<8|t[h+4],t[h+7]<<8|t[h+6]),this.v2.add(c.multiply(a)).rotl(31).multiply(s),h+=8,c=n(t[h+1]<<8|t[h],t[h+3]<<8|t[h+2],t[h+5]<<8|t[h+4],t[h+7]<<8|t[h+6]),this.v3.add(c.multiply(a)).rotl(31).multiply(s),h+=8,c=n(t[h+1]<<8|t[h],t[h+3]<<8|t[h+2],t[h+5]<<8|t[h+4],t[h+7]<<8|t[h+6]),this.v4.add(c.multiply(a)).rotl(31).multiply(s)}h+=8}while(p>=h)}return f>h&&(o?this.memory+=t.slice(h):i?this.memory.set(t.subarray(h,f),this.memsize):t.copy(this.memory,this.memsize,h,f),this.memsize=f-h),this},o.prototype.digest=function(){var t,r,i=this.memory,e="string"==typeof i,o=0,h=this.memsize,c=new n;for(this.total_len>=32?(t=this.v1.clone().rotl(1),t.add(this.v2.clone().rotl(7)),t.add(this.v3.clone().rotl(12)),t.add(this.v4.clone().rotl(18)),t.xor(this.v1.multiply(a).rotl(31).multiply(s)),t.multiply(s).add(f),t.xor(this.v2.multiply(a).rotl(31).multiply(s)),t.multiply(s).add(f),t.xor(this.v3.multiply(a).rotl(31).multiply(s)),t.multiply(s).add(f),t.xor(this.v4.multiply(a).rotl(31).multiply(s)),t.multiply(s).add(f)):t=this.seed.clone().add(l),t.add(c.fromNumber(this.total_len));h-8>=o;)e?c.fromBits(i.charCodeAt(o+1)<<8|i.charCodeAt(o),i.charCodeAt(o+3)<<8|i.charCodeAt(o+2),i.charCodeAt(o+5)<<8|i.charCodeAt(o+4),i.charCodeAt(o+7)<<8|i.charCodeAt(o+6)):c.fromBits(i[o+1]<<8|i[o],i[o+3]<<8|i[o+2],i[o+5]<<8|i[o+4],i[o+7]<<8|i[o+6]),c.multiply(a).rotl(31).multiply(s),t.xor(c).rotl(27).multiply(s).add(f),o+=8;for(h>=o+4&&(e?c.fromBits(i.charCodeAt(o+1)<<8|i.charCodeAt(o),i.charCodeAt(o+3)<<8|i.charCodeAt(o+2),0,0):c.fromBits(i[o+1]<<8|i[o],i[o+3]<<8|i[o+2],0,0),t.xor(c.multiply(s)).rotl(23).multiply(a).add(u),o+=4);h>o;)c.fromBits(e?i.charCodeAt(o++):i[o++],0,0,0),t.xor(c.multiply(l)).rotl(11).multiply(s);return r=t.clone().shiftRight(33),t.xor(r).multiply(a),r=t.clone().shiftRight(29),t.xor(r).multiply(u),r=t.clone().shiftRight(32),t.xor(r),this.init(this.seed),t},t.exports=o}).call(r,i(0).Buffer)}])}); \ No newline at end of file +!function(t,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof exports?exports.XXH=i():t.XXH=i()}("undefined"!=typeof self?self:this,function(){return function(t){function i(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,i),n.l=!0,n.exports}var r={};return i.m=t,i.c=r,i.d=function(t,r,e){i.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:e})},i.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(r,"a",r),r},i.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},i.p="",i(i.s=2)}([function(t,i,r){"use strict";(function(t){function e(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function n(t,i){if(e()=e())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),o.alloc(+t)}function m(t,i){if(o.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var e=!1;;)switch(i){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return X(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(t).length;default:if(e)return X(t).length;i=(""+i).toLowerCase(),e=!0}}function g(t,i,r){var e=!1;if((void 0===i||i<0)&&(i=0),i>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,i>>>=0,r<=i)return"";for(t||(t="utf8");;)switch(t){case"hex":return Y(this,i,r);case"utf8":case"utf-8":return x(this,i,r);case"ascii":return S(this,i,r);case"latin1":case"binary":return I(this,i,r);case"base64":return P(this,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,i,r);default:if(e)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),e=!0}}function d(t,i,r){var e=t[i];t[i]=t[r],t[r]=e}function w(t,i,r,e,n){if(0===t.length)return-1;if("string"==typeof r?(e=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof i&&(i=o.from(i,e)),o.isBuffer(i))return 0===i.length?-1:v(t,i,r,e,n);if("number"==typeof i)return i&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,i,r):Uint8Array.prototype.lastIndexOf.call(t,i,r):v(t,[i],r,e,n);throw new TypeError("val must be string, number or Buffer")}function v(t,i,r,e,n){function o(t,i){return 1===h?t[i]:t.readUInt16BE(i*h)}var h=1,s=t.length,a=i.length;if(void 0!==e&&("ucs2"===(e=String(e).toLowerCase())||"ucs-2"===e||"utf16le"===e||"utf-16le"===e)){if(t.length<2||i.length<2)return-1;h=2,s/=2,a/=2,r/=2}var u;if(n){var f=-1;for(u=r;us&&(r=s-a),u=r;u>=0;u--){for(var l=!0,p=0;pn&&(e=n):e=n;var o=i.length;if(o%2!=0)throw new TypeError("Invalid hex string");e>o/2&&(e=o/2);for(var h=0;h239?4:o>223?3:o>191?2:1;if(n+s<=r){var a,u,f,l;switch(s){case 1:o<128&&(h=o);break;case 2:a=t[n+1],128==(192&a)&&(l=(31&o)<<6|63&a)>127&&(h=l);break;case 3:a=t[n+1],u=t[n+2],128==(192&a)&&128==(192&u)&&(l=(15&o)<<12|(63&a)<<6|63&u)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:a=t[n+1],u=t[n+2],f=t[n+3],128==(192&a)&&128==(192&u)&&128==(192&f)&&(l=(15&o)<<18|(63&a)<<12|(63&u)<<6|63&f)>65535&&l<1114112&&(h=l)}}null===h?(h=65533,s=1):h>65535&&(h-=65536,e.push(h>>>10&1023|55296),h=56320|1023&h),e.push(h),n+=s}return U(e)}function U(t){var i=t.length;if(i<=$)return String.fromCharCode.apply(String,t);for(var r="",e=0;ee)&&(r=e);for(var n="",o=i;or)throw new RangeError("Trying to access beyond buffer length")}function C(t,i,r,e,n,h){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i>n||it.length)throw new RangeError("Index out of range")}function L(t,i,r,e){i<0&&(i=65535+i+1);for(var n=0,o=Math.min(t.length-r,2);n>>8*(e?n:1-n)}function O(t,i,r,e){i<0&&(i=4294967295+i+1);for(var n=0,o=Math.min(t.length-r,4);n>>8*(e?n:3-n)&255}function N(t,i,r,e,n,o){if(r+e>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,i,r,e,n){return n||N(t,i,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,i,r,e,23,4),r+4}function k(t,i,r,e,n){return n||N(t,i,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,i,r,e,52,8),r+8}function j(t){if(t=F(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function F(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function q(t){return t<16?"0"+t.toString(16):t.toString(16)}function X(t,i){i=i||1/0;for(var r,e=t.length,n=null,o=[],h=0;h55295&&r<57344){if(!n){if(r>56319){(i-=3)>-1&&o.push(239,191,189);continue}if(h+1===e){(i-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(i-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(i-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((i-=1)<0)break;o.push(r)}else if(r<2048){if((i-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((i-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((i-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){for(var i=[],r=0;r>8,n=r%256,o.push(n),o.push(e);return o}function J(t){return K.toByteArray(j(t))}function Z(t,i,r,e){for(var n=0;n=i.length||n>=t.length);++n)i[n+r]=t[n];return n}function G(t){return t!==t}var K=r(5),Q=r(6),W=r(7);i.Buffer=o,i.SlowBuffer=y,i.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),i.kMaxLength=e(),o.poolSize=8192,o._augment=function(t){return t.__proto__=o.prototype,t},o.from=function(t,i,r){return h(null,t,i,r)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(t,i,r){return a(null,t,i,r)},o.allocUnsafe=function(t){return u(null,t)},o.allocUnsafeSlow=function(t){return u(null,t)},o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,i){if(!o.isBuffer(t)||!o.isBuffer(i))throw new TypeError("Arguments must be Buffers");if(t===i)return 0;for(var r=t.length,e=i.length,n=0,h=Math.min(r,e);n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},o.prototype.compare=function(t,i,r,e,n){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===i&&(i=0),void 0===r&&(r=t?t.length:0),void 0===e&&(e=0),void 0===n&&(n=this.length),i<0||r>t.length||e<0||n>this.length)throw new RangeError("out of range index");if(e>=n&&i>=r)return 0;if(e>=n)return-1;if(i>=r)return 1;if(i>>>=0,r>>>=0,e>>>=0,n>>>=0,this===t)return 0;for(var h=n-e,s=r-i,a=Math.min(h,s),u=this.slice(e,n),f=t.slice(i,r),l=0;ln)&&(r=n),t.length>0&&(r<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");for(var o=!1;;)switch(e){case"hex":return b(this,t,i,r);case"utf8":case"utf-8":return A(this,t,i,r);case"ascii":return E(this,t,i,r);case"latin1":case"binary":return R(this,t,i,r);case"base64":return B(this,t,i,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,i,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;o.prototype.slice=function(t,i){var r=this.length;t=~~t,i=void 0===i?r:~~i,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),i<0?(i+=r)<0&&(i=0):i>r&&(i=r),i0&&(n*=256);)e+=this[t+--i]*n;return e},o.prototype.readUInt8=function(t,i){return i||M(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,i){return i||M(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,i){return i||M(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,i){return i||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,i){return i||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,i,r){t|=0,i|=0,r||M(t,i,this.length);for(var e=this[t],n=1,o=0;++o=n&&(e-=Math.pow(2,8*i)),e},o.prototype.readIntBE=function(t,i,r){t|=0,i|=0,r||M(t,i,this.length);for(var e=i,n=1,o=this[t+--e];e>0&&(n*=256);)o+=this[t+--e]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*i)),o},o.prototype.readInt8=function(t,i){return i||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,i){i||M(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,i){i||M(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,i){return i||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,i){return i||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,i){return i||M(t,4,this.length),Q.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,i){return i||M(t,4,this.length),Q.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,i){return i||M(t,8,this.length),Q.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,i){return i||M(t,8,this.length),Q.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,i,r,e){if(t=+t,i|=0,r|=0,!e){C(this,t,i,r,Math.pow(2,8*r)-1,0)}var n=1,o=0;for(this[i]=255&t;++o=0&&(o*=256);)this[i+n]=t/o&255;return i+r},o.prototype.writeUInt8=function(t,i,r){return t=+t,i|=0,r||C(this,t,i,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[i]=255&t,i+1},o.prototype.writeUInt16LE=function(t,i,r){return t=+t,i|=0,r||C(this,t,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=255&t,this[i+1]=t>>>8):L(this,t,i,!0),i+2},o.prototype.writeUInt16BE=function(t,i,r){return t=+t,i|=0,r||C(this,t,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=t>>>8,this[i+1]=255&t):L(this,t,i,!1),i+2},o.prototype.writeUInt32LE=function(t,i,r){return t=+t,i|=0,r||C(this,t,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i+3]=t>>>24,this[i+2]=t>>>16,this[i+1]=t>>>8,this[i]=255&t):O(this,t,i,!0),i+4},o.prototype.writeUInt32BE=function(t,i,r){return t=+t,i|=0,r||C(this,t,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=255&t):O(this,t,i,!1),i+4},o.prototype.writeIntLE=function(t,i,r,e){if(t=+t,i|=0,!e){var n=Math.pow(2,8*r-1);C(this,t,i,r,n-1,-n)}var o=0,h=1,s=0;for(this[i]=255&t;++o>0)-s&255;return i+r},o.prototype.writeIntBE=function(t,i,r,e){if(t=+t,i|=0,!e){var n=Math.pow(2,8*r-1);C(this,t,i,r,n-1,-n)}var o=r-1,h=1,s=0;for(this[i+o]=255&t;--o>=0&&(h*=256);)t<0&&0===s&&0!==this[i+o+1]&&(s=1),this[i+o]=(t/h>>0)-s&255;return i+r},o.prototype.writeInt8=function(t,i,r){return t=+t,i|=0,r||C(this,t,i,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[i]=255&t,i+1},o.prototype.writeInt16LE=function(t,i,r){return t=+t,i|=0,r||C(this,t,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=255&t,this[i+1]=t>>>8):L(this,t,i,!0),i+2},o.prototype.writeInt16BE=function(t,i,r){return t=+t,i|=0,r||C(this,t,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=t>>>8,this[i+1]=255&t):L(this,t,i,!1),i+2},o.prototype.writeInt32LE=function(t,i,r){return t=+t,i|=0,r||C(this,t,i,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[i]=255&t,this[i+1]=t>>>8,this[i+2]=t>>>16,this[i+3]=t>>>24):O(this,t,i,!0),i+4},o.prototype.writeInt32BE=function(t,i,r){return t=+t,i|=0,r||C(this,t,i,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=255&t):O(this,t,i,!1),i+4},o.prototype.writeFloatLE=function(t,i,r){return D(this,t,i,!0,r)},o.prototype.writeFloatBE=function(t,i,r){return D(this,t,i,!1,r)},o.prototype.writeDoubleLE=function(t,i,r){return k(this,t,i,!0,r)},o.prototype.writeDoubleBE=function(t,i,r){return k(this,t,i,!1,r)},o.prototype.copy=function(t,i,r,e){if(r||(r=0),e||0===e||(e=this.length),i>=t.length&&(i=t.length),i||(i=0),e>0&&e=this.length)throw new RangeError("sourceStart out of bounds");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),t.length-i=0;--n)t[n+i]=this[n+r];else if(h<1e3||!o.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var h;if("number"==typeof t)for(h=i;h>6,128|63&n):n<55296||n>=57344?i.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&t.charCodeAt(r)),i.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return new Uint8Array(i)}function n(){return 2==arguments.length?new n(arguments[1]).update(arguments[0]).digest():this instanceof n?void o.call(this,arguments[0]):new n(arguments[0])}function o(t){return this.seed=t instanceof h?t.clone():h(t),this.v1=this.seed.clone().add(s).add(a),this.v2=this.seed.clone().add(a),this.v3=this.seed.clone(),this.v4=this.seed.clone().subtract(s),this.total_len=0,this.memsize=0,this.memory=null,this}var h=r(1).UINT32;h.prototype.xxh_update=function(t,i){var r,e,n=a._low,o=a._high;e=t*n,r=e>>>16,r+=i*n,r&=65535,r+=t*o;var h=this._low+(65535&e),u=h>>>16;u+=this._high+(65535&r);var f=u<<16|65535&h;f=f<<13|f>>>19,h=65535&f,u=f>>>16,n=s._low,o=s._high,e=h*n,r=e>>>16,r+=u*n,r&=65535,r+=h*o,this._low=65535&e,this._high=65535&r};var s=h("2654435761"),a=h("2246822519"),u=h("3266489917"),f=h("668265263"),l=h("374761393");n.prototype.init=o,n.prototype.update=function(t){var r;"string"==typeof t?(t=e(t),r=!0):"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?(r=!0,t=new Uint8Array(t)):t instanceof Uint8Array&&(r=!0);var n=0,o=t.length,h=n+o;if(0==o)return this;if(this.total_len+=o,0==this.memsize&&(this.memory=r?new Uint8Array(16):new i(16)),this.memsize+o<16)return r?this.memory.set(t.subarray(0,o),this.memsize):t.copy(this.memory,this.memsize,0,o),this.memsize+=o,this;if(this.memsize>0){r?this.memory.set(t.subarray(0,16-this.memsize),this.memsize):t.copy(this.memory,this.memsize,0,16-this.memsize);var s=0;this.v1.xxh_update(this.memory[s+1]<<8|this.memory[s],this.memory[s+3]<<8|this.memory[s+2]),s+=4,this.v2.xxh_update(this.memory[s+1]<<8|this.memory[s],this.memory[s+3]<<8|this.memory[s+2]),s+=4,this.v3.xxh_update(this.memory[s+1]<<8|this.memory[s],this.memory[s+3]<<8|this.memory[s+2]),s+=4,this.v4.xxh_update(this.memory[s+1]<<8|this.memory[s],this.memory[s+3]<<8|this.memory[s+2]),n+=16-this.memsize,this.memsize=0}if(n<=h-16){var a=h-16;do{this.v1.xxh_update(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2]),n+=4,this.v2.xxh_update(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2]),n+=4,this.v3.xxh_update(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2]),n+=4,this.v4.xxh_update(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2]),n+=4}while(n<=a)}return n=16?this.v1.rotl(1).add(this.v2.rotl(7).add(this.v3.rotl(12).add(this.v4.rotl(18)))):this.seed.clone().add(l),t.add(o.fromNumber(this.total_len));e<=n-4;)o.fromBits(r[e+1]<<8|r[e],r[e+3]<<8|r[e+2]),t.add(o.multiply(u)).rotl(17).multiply(f),e+=4;for(;e0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=i),[r,r===i?0:4-r%4]}function n(t){var i=e(t),r=i[0],n=i[1];return 3*(r+n)/4-n}function o(t,i,r){return 3*(i+r)/4-r}function h(t){var i,r,n=e(t),h=n[0],s=n[1],a=new p(o(t,h,s)),u=0,f=s>0?h-4:h;for(r=0;r>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===s&&(i=l[t.charCodeAt(r)]<<2|l[t.charCodeAt(r+1)]>>4,a[u++]=255&i),1===s&&(i=l[t.charCodeAt(r)]<<10|l[t.charCodeAt(r+1)]<<4|l[t.charCodeAt(r+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}function s(t){return f[t>>18&63]+f[t>>12&63]+f[t>>6&63]+f[63&t]}function a(t,i,r){for(var e,n=[],o=i;oh?h:o+16383));return 1===e?(i=t[r-1],n.push(f[i>>2]+f[i<<4&63]+"==")):2===e&&(i=(t[r-2]<<8)+t[r-1],n.push(f[i>>10]+f[i>>4&63]+f[i<<2&63]+"=")),n.join("")}i.byteLength=n,i.toByteArray=h,i.fromByteArray=u;for(var f=[],l=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,y=_.length;c>1,f=-7,l=r?n-1:0,p=r?-1:1,_=t[i+l];for(l+=p,o=_&(1<<-f)-1,_>>=-f,f+=s;f>0;o=256*o+t[i+l],l+=p,f-=8);for(h=o&(1<<-f)-1,o>>=-f,f+=e;f>0;h=256*h+t[i+l],l+=p,f-=8);if(0===o)o=1-u;else{if(o===a)return h?NaN:1/0*(_?-1:1);h+=Math.pow(2,e),o-=u}return(_?-1:1)*h*Math.pow(2,o-e)},i.write=function(t,i,r,e,n,o){var h,s,a,u=8*o-n-1,f=(1<>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,_=e?0:o-1,c=e?1:-1,y=i<0||0===i&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(s=isNaN(i)?1:0,h=f):(h=Math.floor(Math.log(i)/Math.LN2),i*(a=Math.pow(2,-h))<1&&(h--,a*=2),i+=h+l>=1?p/a:p*Math.pow(2,1-l),i*a>=2&&(h++,a/=2),h+l>=f?(s=0,h=f):h+l>=1?(s=(i*a-1)*Math.pow(2,n),h+=l):(s=i*Math.pow(2,l-1)*Math.pow(2,n),h=0));n>=8;t[r+_]=255&s,_+=c,s/=256,n-=8);for(h=h<0;t[r+_]=255&h,_+=c,h/=256,u-=8);t[r+_-c]|=128*y}},function(t,i){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,i,r){var e,n;!function(r){function o(t,i){return this instanceof o?(this._low=0,this._high=0,this.remainder=null,void 0===i?s.call(this,t):"string"==typeof t?a.call(this,t,i):void h.call(this,t,i)):new o(t,i)}function h(t,i){return this._low=0|t,this._high=0|i,this}function s(t){return this._low=65535&t,this._high=t>>>16,this}function a(t,i){var r=parseInt(t,i||10);return this._low=65535&r,this._high=r>>>16,this}o(Math.pow(36,5)),o(Math.pow(16,7)),o(Math.pow(10,9)),o(Math.pow(2,30)),o(36),o(16),o(10),o(2);o.prototype.fromBits=h,o.prototype.fromNumber=s,o.prototype.fromString=a,o.prototype.toNumber=function(){return 65536*this._high+this._low},o.prototype.toString=function(t){return this.toNumber().toString(t||10)},o.prototype.add=function(t){var i=this._low+t._low,r=i>>>16;return r+=this._high+t._high,this._low=65535&i,this._high=65535&r,this},o.prototype.subtract=function(t){return this.add(t.clone().negate())},o.prototype.multiply=function(t){var i,r,e=this._high,n=this._low,o=t._high,h=t._low;return r=n*h,i=r>>>16,i+=e*h,i&=65535,i+=n*o,this._low=65535&r,this._high=65535&i,this},o.prototype.div=function(t){if(0==t._low&&0==t._high)throw Error("division by zero");if(0==t._high&&1==t._low)return this.remainder=new o(0),this;if(t.gt(this))return this.remainder=this.clone(),this._low=0,this._high=0,this;if(this.eq(t))return this.remainder=new o(0),this._low=1,this._high=0,this;for(var i=t.clone(),r=-1;!this.lt(i);)i.shiftLeft(1,!0),r++;for(this.remainder=this.clone(),this._low=0,this._high=0;r>=0;r--)i.shiftRight(1),this.remainder.lt(i)||(this.remainder.subtract(i),r>=16?this._high|=1<>>16)&65535,this},o.prototype.equals=o.prototype.eq=function(t){return this._low==t._low&&this._high==t._high},o.prototype.greaterThan=o.prototype.gt=function(t){return this._high>t._high||!(this._hight._low},o.prototype.lessThan=o.prototype.lt=function(t){return this._hight._high)&&this._low16?(this._low=this._high>>t-16,this._high=0):16==t?(this._low=this._high,this._high=0):(this._low=this._low>>t|this._high<<16-t&65535,this._high>>=t),this},o.prototype.shiftLeft=o.prototype.shiftl=function(t,i){return t>16?(this._high=this._low<>16-t,this._low=this._low<>>32-t,this._low=65535&i,this._high=i>>>16,this},o.prototype.rotateRight=o.prototype.rotr=function(t){var i=this._high<<16|this._low;return i=i>>>t|i<<32-t,this._low=65535&i,this._high=i>>>16,this},o.prototype.clone=function(){return new o(this._low,this._high)},e=[],void 0!==(n=function(){return o}.apply(i,e))&&(t.exports=n)}()},function(t,i,r){var e,n;!function(r){function o(t,i,r,e){return this instanceof o?(this.remainder=null,"string"==typeof t?a.call(this,t,i):void 0===i?s.call(this,t):void h.apply(this,arguments)):new o(t,i,r,e)}function h(t,i,r,e){return void 0===r?(this._a00=65535&t,this._a16=t>>>16,this._a32=65535&i,this._a48=i>>>16,this):(this._a00=0|t,this._a16=0|i,this._a32=0|r,this._a48=0|e,this)}function s(t){return this._a00=65535&t,this._a16=t>>>16,this._a32=0,this._a48=0,this}function a(t,i){i=i||10,this._a00=0,this._a16=0,this._a32=0,this._a48=0;for(var r=u[i]||new o(Math.pow(i,5)),e=0,n=t.length;e=0&&(r.div(i),e[n]=r.remainder.toNumber().toString(t),r.gt(i));n--);return e[n-1]=r.toNumber().toString(t),e.join("")},o.prototype.add=function(t){var i=this._a00+t._a00,r=i>>>16;r+=this._a16+t._a16;var e=r>>>16;e+=this._a32+t._a32;var n=e>>>16;return n+=this._a48+t._a48,this._a00=65535&i,this._a16=65535&r,this._a32=65535&e,this._a48=65535&n,this},o.prototype.subtract=function(t){return this.add(t.clone().negate())},o.prototype.multiply=function(t){var i=this._a00,r=this._a16,e=this._a32,n=this._a48,o=t._a00,h=t._a16,s=t._a32,a=t._a48,u=i*o,f=u>>>16;f+=i*h;var l=f>>>16;f&=65535,f+=r*o,l+=f>>>16,l+=i*s;var p=l>>>16;return l&=65535,l+=r*h,p+=l>>>16,l&=65535,l+=e*o,p+=l>>>16,p+=i*a,p&=65535,p+=r*s,p&=65535,p+=e*h,p&=65535,p+=n*o,this._a00=65535&u,this._a16=65535&f,this._a32=65535&l,this._a48=65535&p,this},o.prototype.div=function(t){if(0==t._a16&&0==t._a32&&0==t._a48){if(0==t._a00)throw Error("division by zero");if(1==t._a00)return this.remainder=new o(0),this}if(t.gt(this))return this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0,this +;if(this.eq(t))return this.remainder=new o(0),this._a00=1,this._a16=0,this._a32=0,this._a48=0,this;for(var i=t.clone(),r=-1;!this.lt(i);)i.shiftLeft(1,!0),r++;for(this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0;r>=0;r--)i.shiftRight(1),this.remainder.lt(i)||(this.remainder.subtract(i),r>=48?this._a48|=1<=32?this._a32|=1<=16?this._a16|=1<>>16),this._a16=65535&t,t=(65535&~this._a32)+(t>>>16),this._a32=65535&t,this._a48=~this._a48+(t>>>16)&65535,this},o.prototype.equals=o.prototype.eq=function(t){return this._a48==t._a48&&this._a00==t._a00&&this._a32==t._a32&&this._a16==t._a16},o.prototype.greaterThan=o.prototype.gt=function(t){return this._a48>t._a48||!(this._a48t._a32||!(this._a32t._a16||!(this._a16t._a00))},o.prototype.lessThan=o.prototype.lt=function(t){return this._a48t._a48)&&(this._a32t._a32)&&(this._a16t._a16)&&this._a00=48?(this._a00=this._a48>>t-48,this._a16=0,this._a32=0,this._a48=0):t>=32?(t-=32,this._a00=65535&(this._a32>>t|this._a48<<16-t),this._a16=this._a48>>t&65535,this._a32=0,this._a48=0):t>=16?(t-=16,this._a00=65535&(this._a16>>t|this._a32<<16-t),this._a16=65535&(this._a32>>t|this._a48<<16-t),this._a32=this._a48>>t&65535,this._a48=0):(this._a00=65535&(this._a00>>t|this._a16<<16-t),this._a16=65535&(this._a16>>t|this._a32<<16-t),this._a32=65535&(this._a32>>t|this._a48<<16-t),this._a48=this._a48>>t&65535),this},o.prototype.shiftLeft=o.prototype.shiftl=function(t,i){return t%=64,t>=48?(this._a48=this._a00<=32?(t-=32,this._a48=this._a16<>16-t,this._a32=this._a00<=16?(t-=16,this._a48=this._a32<>16-t,this._a32=65535&(this._a16<>16-t),this._a16=this._a00<>16-t,this._a32=65535&(this._a32<>16-t),this._a16=65535&(this._a16<>16-t),this._a00=this._a00<=32){var i=this._a00;if(this._a00=this._a32,this._a32=i,i=this._a48,this._a48=this._a16,this._a16=i,32==t)return this;t-=32}var r=this._a48<<16|this._a32,e=this._a16<<16|this._a00,n=r<>>32-t,o=e<>>32-t;return this._a00=65535&o,this._a16=o>>>16,this._a32=65535&n,this._a48=n>>>16,this},o.prototype.rotateRight=o.prototype.rotr=function(t){if(0==(t%=64))return this;if(t>=32){var i=this._a00;if(this._a00=this._a32,this._a32=i,i=this._a48,this._a48=this._a16,this._a16=i,32==t)return this;t-=32}var r=this._a48<<16|this._a32,e=this._a16<<16|this._a00,n=r>>>t|e<<32-t,o=e>>>t|r<<32-t;return this._a00=65535&o,this._a16=o>>>16,this._a32=65535&n,this._a48=n>>>16,this},o.prototype.clone=function(){return new o(this._a00,this._a16,this._a32,this._a48)},e=[],void 0!==(n=function(){return o}.apply(i,e))&&(t.exports=n)}()},function(t,i,r){(function(i){function e(t){for(var i=[],r=0,e=t.length;r>6,128|63&n):n<55296||n>=57344?i.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&t.charCodeAt(r)),i.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return new Uint8Array(i)}function n(){return 2==arguments.length?new n(arguments[1]).update(arguments[0]).digest():this instanceof n?void o.call(this,arguments[0]):new n(arguments[0])}function o(t){return this.seed=t instanceof h?t.clone():h(t),this.v1=this.seed.clone().add(s).add(a),this.v2=this.seed.clone().add(a),this.v3=this.seed.clone(),this.v4=this.seed.clone().subtract(s),this.total_len=0,this.memsize=0,this.memory=null,this}var h=r(1).UINT64,s=h("11400714785074694791"),a=h("14029467366897019727"),u=h("1609587929392839161"),f=h("9650029242287828579"),l=h("2870177450012600261");n.prototype.init=o,n.prototype.update=function(t){var r;"string"==typeof t?(t=e(t),r=!0):"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?(r=!0,t=new Uint8Array(t)):t instanceof Uint8Array&&(r=!0);var n=0,o=t.length,u=n+o;if(0==o)return this;if(this.total_len+=o,0==this.memsize&&(this.memory=r?new Uint8Array(32):new i(32)),this.memsize+o<32)return r?this.memory.set(t.subarray(0,o),this.memsize):t.copy(this.memory,this.memsize,0,o),this.memsize+=o,this;if(this.memsize>0){r?this.memory.set(t.subarray(0,32-this.memsize),this.memsize):t.copy(this.memory,this.memsize,0,32-this.memsize);var f,l=0;f=h(this.memory[l+1]<<8|this.memory[l],this.memory[l+3]<<8|this.memory[l+2],this.memory[l+5]<<8|this.memory[l+4],this.memory[l+7]<<8|this.memory[l+6]),this.v1.add(f.multiply(a)).rotl(31).multiply(s),l+=8,f=h(this.memory[l+1]<<8|this.memory[l],this.memory[l+3]<<8|this.memory[l+2],this.memory[l+5]<<8|this.memory[l+4],this.memory[l+7]<<8|this.memory[l+6]),this.v2.add(f.multiply(a)).rotl(31).multiply(s),l+=8,f=h(this.memory[l+1]<<8|this.memory[l],this.memory[l+3]<<8|this.memory[l+2],this.memory[l+5]<<8|this.memory[l+4],this.memory[l+7]<<8|this.memory[l+6]),this.v3.add(f.multiply(a)).rotl(31).multiply(s),l+=8,f=h(this.memory[l+1]<<8|this.memory[l],this.memory[l+3]<<8|this.memory[l+2],this.memory[l+5]<<8|this.memory[l+4],this.memory[l+7]<<8|this.memory[l+6]),this.v4.add(f.multiply(a)).rotl(31).multiply(s),n+=32-this.memsize,this.memsize=0}if(n<=u-32){var p=u-32;do{var f;f=h(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2],t[n+5]<<8|t[n+4],t[n+7]<<8|t[n+6]),this.v1.add(f.multiply(a)).rotl(31).multiply(s),n+=8,f=h(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2],t[n+5]<<8|t[n+4],t[n+7]<<8|t[n+6]),this.v2.add(f.multiply(a)).rotl(31).multiply(s),n+=8,f=h(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2],t[n+5]<<8|t[n+4],t[n+7]<<8|t[n+6]),this.v3.add(f.multiply(a)).rotl(31).multiply(s),n+=8,f=h(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2],t[n+5]<<8|t[n+4],t[n+7]<<8|t[n+6]),this.v4.add(f.multiply(a)).rotl(31).multiply(s),n+=8}while(n<=p)}return n=32?(t=this.v1.clone().rotl(1),t.add(this.v2.clone().rotl(7)),t.add(this.v3.clone().rotl(12)),t.add(this.v4.clone().rotl(18)),t.xor(this.v1.multiply(a).rotl(31).multiply(s)),t.multiply(s).add(f),t.xor(this.v2.multiply(a).rotl(31).multiply(s)),t.multiply(s).add(f),t.xor(this.v3.multiply(a).rotl(31).multiply(s)),t.multiply(s).add(f),t.xor(this.v4.multiply(a).rotl(31).multiply(s)),t.multiply(s).add(f)):t=this.seed.clone().add(l),t.add(o.fromNumber(this.total_len));e<=n-8;)o.fromBits(r[e+1]<<8|r[e],r[e+3]<<8|r[e+2],r[e+5]<<8|r[e+4],r[e+7]<<8|r[e+6]),o.multiply(a).rotl(31).multiply(s),t.xor(o).rotl(27).multiply(s).add(f),e+=8;for(e+4<=n&&(o.fromBits(r[e+1]<<8|r[e],r[e+3]<<8|r[e+2],0,0),t.xor(o.multiply(s)).rotl(23).multiply(a).add(u),e+=4);e