hamt-sharding
Advanced tools
Comparing version 0.0.2 to 1.0.0
@@ -0,1 +1,11 @@ | ||
<a name="1.0.0"></a> | ||
# [1.0.0](https://github.com/ipfs-shipyard/js-hamt-sharding/compare/v0.0.2...v1.0.0) (2020-01-08) | ||
### Bug Fixes | ||
* linting ([83e6192](https://github.com/ipfs-shipyard/js-hamt-sharding/commit/83e6192)) | ||
## 0.0.2 (2018-11-23) | ||
@@ -2,0 +12,0 @@ |
@@ -1,2 +0,3 @@ | ||
var HamtSharding=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function e(){return t.default}:function e(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}({"../../node_modules/base64-js/index.js":function(t,e,r){"use strict";e.byteLength=f,e.toByteArray=l,e.fromByteArray=d;for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,h=s.length;u<h;++u)n[u]=s[u],i[s.charCodeAt(u)]=u;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("="),n;return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n}function c(t,e,r){return 3*(e+r)/4-r}function l(t){for(var e,r=a(t),n=r[0],s=r[1],u=new o(c(t,n,s)),h=0,f=s>0?n-4:n,l=0;l<f;l+=4)e=i[t.charCodeAt(l)]<<18|i[t.charCodeAt(l+1)]<<12|i[t.charCodeAt(l+2)]<<6|i[t.charCodeAt(l+3)],u[h++]=e>>16&255,u[h++]=e>>8&255,u[h++]=255&e;return 2===s&&(e=i[t.charCodeAt(l)]<<2|i[t.charCodeAt(l+1)]>>4,u[h++]=255&e),1===s&&(e=i[t.charCodeAt(l)]<<10|i[t.charCodeAt(l+1)]<<4|i[t.charCodeAt(l+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e),u}function p(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[63&t]}function g(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),i.push(p(n));return i.join("")}function d(t){for(var e,r=t.length,i=r%3,o=[],s=16383,u=0,h=r-i;u<h;u+=16383)o.push(g(t,u,u+16383>h?h:u+16383));return 1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},"../../node_modules/buffer/index.js":function(t,e,r){"use strict";(function(t){var n=r("../../node_modules/base64-js/index.js"),i=r("../../node_modules/ieee754/index.js"),o=r("../../node_modules/isarray/index.js");function s(){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}}function u(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function h(t,e){if(u()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=a.prototype:(null===t&&(t=new a(e)),t.length=e),t}function a(t,e,r){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return p(this,t)}return f(this,t,e,r)}function f(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?_(t,e,r,n):"string"==typeof e?g(t,e,r):y(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e,r,n){return c(e),e<=0?h(t,e):void 0!==r?"string"==typeof n?h(t,e).fill(r,n):h(t,e).fill(r):h(t,e)}function p(t,e){if(c(e),t=h(t,e<0?0:0|w(e)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function g(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!a.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(e,r),i=(t=h(t,n)).write(e,r);return i!==n&&(t=t.slice(0,i)),t}function d(t,e){var r=e.length<0?0:0|w(e.length);t=h(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function _(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),a.TYPED_ARRAY_SUPPORT?(t=e).__proto__=a.prototype:t=d(t,e),t}function y(t,e){if(a.isBuffer(e)){var r=0|w(e.length);return 0===(t=h(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||et(e.length)?h(t,0):d(t,e);if("Buffer"===e.type&&o(e.data))return d(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|t}function b(t){return+t!=t&&(t=0),a.alloc(+t)}function v(t,e){if(a.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 n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(t).length;default:if(n)return K(t).length;e=(""+e).toLowerCase(),n=!0}}function A(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return j(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return I(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function B(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:P(t,e,r,n,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):P(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function P(t,e,r,n,i){var o=1,s=t.length,u=e.length,h;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,u/=2,r/=2}function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var f=-1;for(h=r;h<s;h++)if(a(t,h)===a(e,-1===f?0:h-f)){if(-1===f&&(f=h),h-f+1===u)return f*o}else-1!==f&&(h-=h-f),f=-1}else for(r+u>s&&(r=s-u),h=r;h>=0;h--){for(var c=!0,l=0;l<u;l++)if(a(t,h+l)!==a(e,l)){c=!1;break}if(c)return h}return-1}function E(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var u=parseInt(e.substr(2*s,2),16);if(isNaN(u))return s;t[r+s]=u}return s}function R(t,e,r,n){return tt(K(e,t.length-r),t,r,n)}function T(t,e,r,n){return tt(Q(e),t,r,n)}function S(t,e,r,n){return T(t,e,r,n)}function U(t,e,r,n){return tt($(e),t,r,n)}function x(t,e,r,n){return tt(W(e,t.length-r),t,r,n)}function I(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],s=null,u=o>239?4:o>223?3:o>191?2:1,h,a,f,c;if(i+u<=r)switch(u){case 1:o<128&&(s=o);break;case 2:128==(192&(h=t[i+1]))&&(c=(31&o)<<6|63&h)>127&&(s=c);break;case 3:h=t[i+1],a=t[i+2],128==(192&h)&&128==(192&a)&&(c=(15&o)<<12|(63&h)<<6|63&a)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:h=t[i+1],a=t[i+2],f=t[i+3],128==(192&h)&&128==(192&a)&&128==(192&f)&&(c=(15&o)<<18|(63&h)<<12|(63&a)<<6|63&f)>65535&&c<1114112&&(s=c)}null===s?(s=65533,u=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=u}return Y(n)}e.Buffer=a,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:s(),e.kMaxLength=u(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return f(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return l(null,t,e,r)},a.allocUnsafe=function(t){return p(null,t)},a.allocUnsafeSlow=function(t){return p(null,t)},a.isBuffer=function t(e){return!(null==e||!e._isBuffer)},a.compare=function t(e,r){if(!a.isBuffer(e)||!a.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0},a.isEncoding=function t(e){switch(String(e).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}},a.concat=function t(e,r){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var n;if(void 0===r)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=a.allocUnsafe(r),s=0;for(n=0;n<e.length;++n){var u=e[n];if(!a.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,s),s+=u.length}return i},a.byteLength=v,a.prototype._isBuffer=!0,a.prototype.swap16=function t(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)B(this,r,r+1);return this},a.prototype.swap32=function t(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)B(this,r,r+3),B(this,r+1,r+2);return this},a.prototype.swap64=function t(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)B(this,r,r+7),B(this,r+1,r+6),B(this,r+2,r+5),B(this,r+3,r+4);return this},a.prototype.toString=function t(){var e=0|this.length;return 0===e?"":0===arguments.length?k(this,0,e):A.apply(this,arguments)},a.prototype.equals=function t(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function t(){var r="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(r=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(r+=" ... ")),"<Buffer "+r+">"},a.prototype.compare=function t(e,r,n,i,o){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var s=o-i,u=n-r,h=Math.min(s,u),f=this.slice(i,o),c=e.slice(r,n),l=0;l<h;++l)if(f[l]!==c[l]){s=f[l],u=c[l];break}return s<u?-1:u<s?1:0},a.prototype.includes=function t(e,r,n){return-1!==this.indexOf(e,r,n)},a.prototype.indexOf=function t(e,r,n){return m(this,e,r,n,!0)},a.prototype.lastIndexOf=function t(e,r,n){return m(this,e,r,n,!1)},a.prototype.write=function t(e,r,n,i){if(void 0===r)i="utf8",n=this.length,r=0;else if(void 0===n&&"string"==typeof r)i=r,n=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(n)?(n|=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var o=this.length-r;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return E(this,e,r,n);case"utf8":case"utf-8":return R(this,e,r,n);case"ascii":return T(this,e,r,n);case"latin1":case"binary":return S(this,e,r,n);case"base64":return U(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},a.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function Y(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=O));return r}function M(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function j(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=G(t[o]);return i}function L(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function D(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function F(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function N(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function z(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function J(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function V(t,e,r,n,o){return o||J(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),i.write(t,e,r,n,23,4),r+4}function X(t,e,r,n,o){return o||J(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),i.write(t,e,r,n,52,8),r+8}a.prototype.slice=function t(e,r){var n=this.length,i;if(e=~~e,r=void 0===r?n:~~r,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),r<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<e&&(r=e),a.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,r)).__proto__=a.prototype;else{var o=r-e;i=new a(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+e]}return i},a.prototype.readUIntLE=function t(e,r,n){e|=0,r|=0,n||D(e,r,this.length);for(var i=this[e],o=1,s=0;++s<r&&(o*=256);)i+=this[e+s]*o;return i},a.prototype.readUIntBE=function t(e,r,n){e|=0,r|=0,n||D(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i},a.prototype.readUInt8=function t(e,r){return r||D(e,1,this.length),this[e]},a.prototype.readUInt16LE=function t(e,r){return r||D(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function t(e,r){return r||D(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function t(e,r){return r||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function t(e,r){return r||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function t(e,r,n){e|=0,r|=0,n||D(e,r,this.length);for(var i=this[e],o=1,s=0;++s<r&&(o*=256);)i+=this[e+s]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*r)),i},a.prototype.readIntBE=function t(e,r,n){e|=0,r|=0,n||D(e,r,this.length);for(var i=r,o=1,s=this[e+--i];i>0&&(o*=256);)s+=this[e+--i]*o;return s>=(o*=128)&&(s-=Math.pow(2,8*r)),s},a.prototype.readInt8=function t(e,r){return r||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function t(e,r){r||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function t(e,r){r||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function t(e,r){return r||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function t(e,r){return r||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function t(e,r){return r||D(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function t(e,r){return r||D(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function t(e,r){return r||D(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function t(e,r){return r||D(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function t(e,r,n,i){var o;(e=+e,r|=0,n|=0,i)||F(this,e,r,n,Math.pow(2,8*n)-1,0);var s=1,u=0;for(this[r]=255&e;++u<n&&(s*=256);)this[r+u]=e/s&255;return r+n},a.prototype.writeUIntBE=function t(e,r,n,i){var o;(e=+e,r|=0,n|=0,i)||F(this,e,r,n,Math.pow(2,8*n)-1,0);var s=n-1,u=1;for(this[r+s]=255&e;--s>=0&&(u*=256);)this[r+s]=e/u&255;return r+n},a.prototype.writeUInt8=function t(e,r,n){return e=+e,r|=0,n||F(this,e,r,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=255&e,r+1},a.prototype.writeUInt16LE=function t(e,r,n){return e=+e,r|=0,n||F(this,e,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):N(this,e,r,!0),r+2},a.prototype.writeUInt16BE=function t(e,r,n){return e=+e,r|=0,n||F(this,e,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):N(this,e,r,!1),r+2},a.prototype.writeUInt32LE=function t(e,r,n){return e=+e,r|=0,n||F(this,e,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=255&e):z(this,e,r,!0),r+4},a.prototype.writeUInt32BE=function t(e,r,n){return e=+e,r|=0,n||F(this,e,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):z(this,e,r,!1),r+4},a.prototype.writeIntLE=function t(e,r,n,i){if(e=+e,r|=0,!i){var o=Math.pow(2,8*n-1);F(this,e,r,n,o-1,-o)}var s=0,u=1,h=0;for(this[r]=255&e;++s<n&&(u*=256);)e<0&&0===h&&0!==this[r+s-1]&&(h=1),this[r+s]=(e/u>>0)-h&255;return r+n},a.prototype.writeIntBE=function t(e,r,n,i){if(e=+e,r|=0,!i){var o=Math.pow(2,8*n-1);F(this,e,r,n,o-1,-o)}var s=n-1,u=1,h=0;for(this[r+s]=255&e;--s>=0&&(u*=256);)e<0&&0===h&&0!==this[r+s+1]&&(h=1),this[r+s]=(e/u>>0)-h&255;return r+n},a.prototype.writeInt8=function t(e,r,n){return e=+e,r|=0,n||F(this,e,r,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=255&e,r+1},a.prototype.writeInt16LE=function t(e,r,n){return e=+e,r|=0,n||F(this,e,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):N(this,e,r,!0),r+2},a.prototype.writeInt16BE=function t(e,r,n){return e=+e,r|=0,n||F(this,e,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):N(this,e,r,!1),r+2},a.prototype.writeInt32LE=function t(e,r,n){return e=+e,r|=0,n||F(this,e,r,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):z(this,e,r,!0),r+4},a.prototype.writeInt32BE=function t(e,r,n){return e=+e,r|=0,n||F(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):z(this,e,r,!1),r+4},a.prototype.writeFloatLE=function t(e,r,n){return V(this,e,r,!0,n)},a.prototype.writeFloatBE=function t(e,r,n){return V(this,e,r,!1,n)},a.prototype.writeDoubleLE=function t(e,r,n){return X(this,e,r,!0,n)},a.prototype.writeDoubleBE=function t(e,r,n){return X(this,e,r,!1,n)},a.prototype.copy=function t(e,r,n,i){if(n||(n=0),i||0===i||(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);var o=i-n,s;if(this===e&&n<r&&r<i)for(s=o-1;s>=0;--s)e[s+r]=this[s+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)e[s+r]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),r);return o},a.prototype.fill=function t(e,r,n,i){if("string"==typeof e){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;var s;if(r>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=r;s<n;++s)this[s]=e;else{var u=a.isBuffer(e)?e:K(new a(e,i).toString()),h=u.length;for(s=0;s<n-r;++s)this[s+r]=u[s%h]}return this};var q=/[^+\/0-9A-Za-z-_]/g;function H(t){if((t=Z(t).replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function Z(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function G(t){return t<16?"0"+t.toString(16):t.toString(16)}function K(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=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((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Q(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function W(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}function $(t){return n.toByteArray(H(t))}function tt(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function et(t){return t!=t}}).call(this,r("../../node_modules/webpack/buildin/global.js"))},"../../node_modules/ieee754/index.js":function(t,e){e.read=function(t,e,r,n,i){var o,s,u=8*i-n-1,h=(1<<u)-1,a=h>>1,f=-7,c=r?i-1:0,l=r?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-f)-1,p>>=-f,f+=u;f>0;o=256*o+t[e+c],c+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+c],c+=l,f-=8);if(0===o)o=1-a;else{if(o===h)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=a}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,u,h,a=8*o-i-1,f=(1<<a)-1,c=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+c>=1?l/h:l*Math.pow(2,1-c))*h>=2&&(s++,h/=2),s+c>=f?(u=0,s=f):s+c>=1?(u=(e*h-1)*Math.pow(2,i),s+=c):(u=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&u,p+=g,u/=256,i-=8);for(s=s<<i|u,a+=i;a>0;t[r+p]=255&s,p+=g,s/=256,a-=8);t[r+p-g]|=128*d}},"../../node_modules/isarray/index.js":function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},"../../node_modules/sparse-array/index.js":function(t,e,r){"use strict";const n=7;function i(t,e){return t+o(e)}function o(t){let e=t;return 16843009*((e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135)>>24}function s(t,e){return t[0]-e[0]}function u(t){return t[1]}t.exports=class t{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(t,e){let r=this._internalPositionFor(t,!1);if(void 0===e)-1!==r&&(this._unsetInternalPos(r),this._unsetBit(t),this._changedLength=!0,this._changedData=!0);else{let n=!1;-1===r?(r=this._data.length,this._setBit(t),this._changedData=!0):n=!0,this._setInternalPos(r,t,e,n),this._changedLength=!0}}unset(t){this.set(t,void 0)}get(t){this._sortData();const e=this._internalPositionFor(t,!0);if(-1!==e)return this._data[e][1]}push(t){return this.set(this.length,t),this.length}get length(){if(this._sortData(),this._changedLength){const t=this._data[this._data.length-1];this._length=t?t[0]+1:0,this._changedLength=!1}return this._length}forEach(t){let e=0;for(;e<this.length;)t(this.get(e),e,this),e++}map(t){let e=0,r=new Array(this.length);for(;e<this.length;)r[e]=t(this.get(e),e,this),e++;return r}reduce(t,e){let r=0,n=e;for(;r<this.length;){const e=this.get(r);n=t(n,e,r),r++}return n}find(t){let e=0,r,n;for(;e<this.length&&!r;)r=t(n=this.get(e)),e++;return r?n:void 0}_internalPositionFor(t,e){const r=this._bytePosFor(t,e);if(r>=this._bitArrays.length)return-1;const n=this._bitArrays[r],s=t-7*r,u=(n&1<<s)>0;if(!u)return-1;const h=this._bitArrays.slice(0,r).reduce(i,0),a=~(4294967295<<s+1),f=o(n&a),c=h+f-1;return c}_bytePosFor(t,e){const r=Math.floor(t/7),n=r+1;for(;!e&&this._bitArrays.length<n;)this._bitArrays.push(0);return r}_setBit(t){const e=this._bytePosFor(t,!1);this._bitArrays[e]|=1<<t-7*e}_unsetBit(t){const e=this._bytePosFor(t,!1);this._bitArrays[e]&=~(1<<t-7*e)}_setInternalPos(t,e,r,n){const i=this._data,o=[e,r];if(n)this._sortData(),i[t]=o;else{if(i.length)if(i[i.length-1][0]>=e)i.push(o);else if(i[0][0]<=e)i.unshift(o);else{const t=Math.round(i.length/2);this._data=i.slice(0,t).concat(o).concat(i.slice(t))}else this._data.push(o);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(t){this._data.splice(t,1)}_sortData(){this._changedData&&this._data.sort(s)}bitField(){const t=[];let e=8,r=0,n=0,i;const o=this._bitArrays.slice();for(;o.length||r;){0===r&&(i=o.shift(),r=7);const s=Math.min(r,e),u=~(255<<s),h=i&u;n|=h<<8-e,i>>>=s,r-=s,(e-=s)&&(r||o.length)||(t.push(n),n=0,e=8)}for(var s=t.length-1;s>0;s--){const e=t[s];if(0!==e)break;t.pop()}return t}compactArray(){return this._sortData(),this._data.map(u)}}},"../../node_modules/webpack/buildin/global.js":function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},"./src/bucket.js":function(t,e,r){"use strict";const n=r("../../node_modules/sparse-array/index.js"),i=r("./src/consumable-hash.js"),o={bits:8};class s{constructor(t,e,r){if(this._options=Object.assign({},o,t),this._popCount=0,this._parent=e,this._posAtParent=r,!this._options.hashFn)throw new Error("please define an options.hashFn");this._options.hash||(this._options.hash=i(this._options.hashFn)),this._children=new n}static isBucket(t){return t instanceof s}async put(t,e){const r=await this._findNewBucketAndPos(t);await r.bucket._putAt(r,t,e)}async get(t){const e=await this._findChild(t);if(e)return e.value}async del(t){const e=await this._findPlace(t),r=e.bucket._at(e.pos);r&&r.key===t&&e.bucket._delAt(e.pos)}leafCount(){return this._children.compactArray().reduce((t,e)=>e instanceof s?t+e.leafCount():t+1,0)}childrenCount(){return this._children.length}onlyChild(){return this._children.get(0)}*eachLeafSeries(){const t=this._children.compactArray();for(const e of t)if(e instanceof s)for(const t of e.eachLeafSeries())yield t;else yield e}serialize(t,e){return e(this._children.reduce((r,n,i)=>(n&&(n instanceof s?r.push(n.serialize(t,e)):r.push(t(n,i))),r),[]))}async asyncTransform(t,e){return f(this,t,e)}toJSON(){return this.serialize(h,a)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}async _findChild(t){const e=await this._findPlace(t),r=e.bucket._at(e.pos);if(r&&r.key===t)return r}async _findPlace(t){const e=this._options.hash(t),r=await e.take(this._options.bits),n=this._children.get(r);return n instanceof s?n._findPlace(e):{bucket:this,pos:r,hash:e}}async _findNewBucketAndPos(t){const e=await this._findPlace(t),r=e.bucket._at(e.pos);if(r&&r.key!==t){const t=new s(this._options,e.bucket,e.pos);e.bucket._putObjectAt(e.pos,t);const n=await t._findPlace(r.hash);return n.bucket._putAt(n,r.key,r.value),t._findNewBucketAndPos(e.hash)}return e}_putAt(t,e,r){this._putObjectAt(t.pos,{key:e,value:r,hash:t.hash})}_putObjectAt(t,e){this._children.get(t)||this._popCount++,this._children.set(t,e)}_delAt(t){this._children.get(t)&&this._popCount--,this._children.unset(t),this._level()}_level(){if(this._parent&&this._popCount<=1)if(1===this._popCount){const t=this._children.find(u);if(!(t instanceof s)){const e=t.hash;e.untake(this._options.bits);const r={pos:this._posAtParent,hash:e};this._parent._putAt(r,t.key,t.value)}}else this._parent._delAt(this._posAtParent)}_at(t){return this._children.get(t)}}function u(t){return Boolean(t)}function h(t,e){return t.key}function a(t){return t}async function f(t,e,r){const n=[];for(const i of t._children.compactArray()){if(i instanceof s)await f(i,e,r);else{const r=await e(i);n.push({bitField:t._children.bitField(),children:r})}return r(n)}}t.exports=s},"./src/consumable-buffer.js":function(t,e,r){"use strict";const n=[255,254,252,248,240,224,192,128],i=[1,3,7,15,31,63,127,255];function o(t,e,r){const n=s(e,r);return(t&n)>>>e}function s(t,e){return n[t]&i[Math.min(e+t-1,7)]}t.exports=class t{constructor(t){this._value=t,this._currentBytePos=t.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+8*this._currentBytePos}totalBits(){return 8*this._value.length}take(t){let e=t,r=0;for(;e&&this._haveBits();){const t=this._value[this._currentBytePos],n=this._currentBitPos+1,i=Math.min(n,e),s=o(t,n-i,i);r=(r<<i)+s,e-=i,this._currentBitPos-=i,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return r}untake(t){for(this._currentBitPos+=t;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}}},"./src/consumable-hash.js":function(t,e,r){"use strict";(function(e){const n=r("./src/consumable-buffer.js");t.exports=function t(e){return function t(r){return r instanceof i?r:new i(r,e)}};class i{constructor(t,r){if("string"!=typeof t&&!e.isBuffer(t))throw new Error("can only hash strings or buffers");this._value=t,this._hashFn=r,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}async take(t){let e=t;for(;this._availableBits<e;)await this._produceMoreBits();let r=0;for(;e>0;){const t=this._buffers[this._currentBufferIndex],n=Math.min(t.availableBits(),e),i=t.take(n);r=(r<<n)+i,e-=n,this._availableBits-=n,0===t.availableBits()&&this._currentBufferIndex++}return r}untake(t){let e=t;for(;e>0;){const t=this._buffers[this._currentBufferIndex],r=Math.min(t.totalBits()-t.availableBits(),e);t.untake(r),e-=r,this._availableBits+=r,this._currentBufferIndex>0&&t.totalBits()===t.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;const t=this._depth?this._value+this._depth:this._value,e=await this._hashFn(t),r=new n(e);this._buffers.push(r),this._availableBits+=r.availableBits()}}}).call(this,r("../../node_modules/buffer/index.js").Buffer)},"./src/index.js":function(t,e,r){"use strict";const n=r("./src/bucket.js");t.exports=function t(e){return new n(e)},t.exports.isBucket=n.isBucket},0:function(t,e,r){t.exports=r("./src/index.js")}}); | ||
/*! For license information please see index.min.js.LICENSE */ | ||
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.HamtSharding=r():t.HamtSharding=r()}(window,(function(){return function(t){var r={};function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var i in t)e.d(n,i,function(r){return t[r]}.bind(null,i));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=0)}([function(t,r,e){t.exports=e(1)},function(t,r,e){"use strict";const n=e(2);t.exports=function(t){return new n(t)},t.exports.isBucket=n.isBucket},function(t,r,e){"use strict";const n=e(3),i=e(4),o={bits:8};class s{constructor(t,r,e){if(this._options=Object.assign({},o,t),this._popCount=0,this._parent=r,this._posAtParent=e,!this._options.hashFn)throw new Error("please define an options.hashFn");this._options.hash||(this._options.hash=i(this._options.hashFn)),this._children=new n}static isBucket(t){return t instanceof s}async put(t,r){const e=await this._findNewBucketAndPos(t);await e.bucket._putAt(e,t,r)}async get(t){const r=await this._findChild(t);if(r)return r.value}async del(t){const r=await this._findPlace(t),e=r.bucket._at(r.pos);e&&e.key===t&&r.bucket._delAt(r.pos)}leafCount(){return this._children.compactArray().reduce((t,r)=>r instanceof s?t+r.leafCount():t+1,0)}childrenCount(){return this._children.length}onlyChild(){return this._children.get(0)}*eachLeafSeries(){const t=this._children.compactArray();for(const r of t)if(r instanceof s)for(const t of r.eachLeafSeries())yield t;else yield r}serialize(t,r){return r(this._children.reduce((e,n,i)=>(n&&(n instanceof s?e.push(n.serialize(t,r)):e.push(t(n,i))),e),[]))}asyncTransform(t,r){return async function t(r,e,n){const i=[];for(const o of r._children.compactArray()){if(o instanceof s)await t(o,e,n);else{const t=await e(o);i.push({bitField:r._children.bitField(),children:t})}return n(i)}}(this,t,r)}toJSON(){return this.serialize(u,a)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}async _findChild(t){const r=await this._findPlace(t),e=r.bucket._at(r.pos);if(e&&e.key===t)return e}async _findPlace(t){const r=this._options.hash(t),e=await r.take(this._options.bits),n=this._children.get(e);return n instanceof s?n._findPlace(r):{bucket:this,pos:e,hash:r}}async _findNewBucketAndPos(t){const r=await this._findPlace(t),e=r.bucket._at(r.pos);if(e&&e.key!==t){const t=new s(this._options,r.bucket,r.pos);r.bucket._putObjectAt(r.pos,t);const n=await t._findPlace(e.hash);return n.bucket._putAt(n,e.key,e.value),t._findNewBucketAndPos(r.hash)}return r}_putAt(t,r,e){this._putObjectAt(t.pos,{key:r,value:e,hash:t.hash})}_putObjectAt(t,r){this._children.get(t)||this._popCount++,this._children.set(t,r)}_delAt(t){this._children.get(t)&&this._popCount--,this._children.unset(t),this._level()}_level(){if(this._parent&&this._popCount<=1)if(1===this._popCount){const t=this._children.find(h);if(!(t instanceof s)){const r=t.hash;r.untake(this._options.bits);const e={pos:this._posAtParent,hash:r};this._parent._putAt(e,t.key,t.value)}}else this._parent._delAt(this._posAtParent)}_at(t){return this._children.get(t)}}function h(t){return Boolean(t)}function u(t,r){return t.key}function a(t){return t}t.exports=s},function(t,r,e){"use strict";function n(t,r){return t+i(r)}function i(t){let r=t;return r-=r>>1&1431655765,r=(858993459&r)+(r>>2&858993459),16843009*(r+(r>>4)&252645135)>>24}function o(t,r){return t[0]-r[0]}function s(t){return t[1]}t.exports=class{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(t,r){let e=this._internalPositionFor(t,!1);if(void 0===r)-1!==e&&(this._unsetInternalPos(e),this._unsetBit(t),this._changedLength=!0,this._changedData=!0);else{let n=!1;-1===e?(e=this._data.length,this._setBit(t),this._changedData=!0):n=!0,this._setInternalPos(e,t,r,n),this._changedLength=!0}}unset(t){this.set(t,void 0)}get(t){this._sortData();const r=this._internalPositionFor(t,!0);if(-1!==r)return this._data[r][1]}push(t){return this.set(this.length,t),this.length}get length(){if(this._sortData(),this._changedLength){const t=this._data[this._data.length-1];this._length=t?t[0]+1:0,this._changedLength=!1}return this._length}forEach(t){let r=0;for(;r<this.length;)t(this.get(r),r,this),r++}map(t){let r=0,e=new Array(this.length);for(;r<this.length;)e[r]=t(this.get(r),r,this),r++;return e}reduce(t,r){let e=0,n=r;for(;e<this.length;){n=t(n,this.get(e),e),e++}return n}find(t){let r,e,n=0;for(;n<this.length&&!r;)e=this.get(n),r=t(e),n++;return r?e:void 0}_internalPositionFor(t,r){const e=this._bytePosFor(t,r);if(e>=this._bitArrays.length)return-1;const o=this._bitArrays[e],s=t-7*e;return(o&1<<s)>0?this._bitArrays.slice(0,e).reduce(n,0)+i(o&~(4294967295<<s+1))-1:-1}_bytePosFor(t,r){const e=Math.floor(t/7),n=e+1;for(;!r&&this._bitArrays.length<n;)this._bitArrays.push(0);return e}_setBit(t){const r=this._bytePosFor(t,!1);this._bitArrays[r]|=1<<t-7*r}_unsetBit(t){const r=this._bytePosFor(t,!1);this._bitArrays[r]&=~(1<<t-7*r)}_setInternalPos(t,r,e,n){const i=this._data,o=[r,e];if(n)this._sortData(),i[t]=o;else{if(i.length)if(i[i.length-1][0]>=r)i.push(o);else if(i[0][0]<=r)i.unshift(o);else{const t=Math.round(i.length/2);this._data=i.slice(0,t).concat(o).concat(i.slice(t))}else this._data.push(o);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(t){this._data.splice(t,1)}_sortData(){this._changedData&&this._data.sort(o),this._changedData=!1}bitField(){const t=[];let r,e=8,n=0,i=0;const o=this._bitArrays.slice();for(;o.length||n;){0===n&&(r=o.shift(),n=7);const s=Math.min(n,e);i|=(r&~(255<<s))<<8-e,r>>>=s,n-=s,e-=s,e&&(n||o.length)||(t.push(i),i=0,e=8)}for(var s=t.length-1;s>0;s--){if(0!==t[s])break;t.pop()}return t}compactArray(){return this._sortData(),this._data.map(s)}}},function(t,r,e){"use strict";(function(r){const n=e(10);t.exports=function(t){return function(r){return r instanceof i?r:new i(r,t)}};class i{constructor(t,e){if("string"!=typeof t&&!r.isBuffer(t))throw new Error("can only hash strings or buffers");this._value=t,this._hashFn=e,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}async take(t){let r=t;for(;this._availableBits<r;)await this._produceMoreBits();let e=0;for(;r>0;){const t=this._buffers[this._currentBufferIndex],n=Math.min(t.availableBits(),r);e=(e<<n)+t.take(n),r-=n,this._availableBits-=n,0===t.availableBits()&&this._currentBufferIndex++}return e}untake(t){let r=t;for(;r>0;){const t=this._buffers[this._currentBufferIndex],e=Math.min(t.totalBits()-t.availableBits(),r);t.untake(e),r-=e,this._availableBits+=e,this._currentBufferIndex>0&&t.totalBits()===t.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;const t=this._depth?this._value+this._depth:this._value,r=await this._hashFn(t),e=new n(r);this._buffers.push(e),this._availableBits+=e.availableBits()}}}).call(this,e(5).Buffer)},function(t,r,e){"use strict";(function(t){var n=e(7),i=e(8),o=e(9);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function h(t,r){if(s()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=u.prototype:(null===t&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return a(this,t,r,e)}function a(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);u.TYPED_ARRAY_SUPPORT?(t=r).__proto__=u.prototype:t=l(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(r,e),i=(t=h(t,n)).write(r,e);i!==n&&(t=t.slice(0,i));return t}(t,r,e):function(t,r){if(u.isBuffer(r)){var e=0|p(r.length);return 0===(t=h(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?h(t,0):l(t,r);if("Buffer"===r.type&&o(r.data))return l(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function c(t,r){if(f(r),t=h(t,r<0?0:0|p(r)),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r){var e=r.length<0?0:0|p(r.length);t=h(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function p(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function g(t,r){if(u.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 e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return j(t).length;default:if(n)return N(t).length;r=(""+r).toLowerCase(),n=!0}}function _(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return U(this,r,e);case"utf8":case"utf-8":return R(this,r,e);case"ascii":return T(this,r,e);case"latin1":case"binary":return S(this,r,e);case"base64":return m(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function d(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=u.from(r,n)),u.isBuffer(r))return 0===r.length?-1:w(t,r,e,n,i);if("number"==typeof r)return r&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):w(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function w(t,r,e,n,i){var o,s=1,h=t.length,u=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;s=2,h/=2,u/=2,e/=2}function a(t,r){return 1===s?t[r]:t.readUInt16BE(r*s)}if(i){var f=-1;for(o=e;o<h;o++)if(a(t,o)===a(r,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(e+u>h&&(e=h-u),o=e;o>=0;o--){for(var c=!0,l=0;l<u;l++)if(a(t,o+l)!==a(r,l)){c=!1;break}if(c)return o}return-1}function b(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var h=parseInt(r.substr(2*s,2),16);if(isNaN(h))return s;t[e+s]=h}return s}function v(t,r,e,n){return z(N(r,t.length-e),t,e,n)}function A(t,r,e,n){return z(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function B(t,r,e,n){return A(t,r,e,n)}function P(t,r,e,n){return z(j(r),t,e,n)}function E(t,r,e,n){return z(function(t,r){for(var e,n,i,o=[],s=0;s<t.length&&!((r-=2)<0);++s)e=t.charCodeAt(s),n=e>>8,i=e%256,o.push(i),o.push(n);return o}(r,t.length-e),t,e,n)}function m(t,r,e){return 0===r&&e===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(r,e))}function R(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,s,h,u,a=t[i],f=null,c=a>239?4:a>223?3:a>191?2:1;if(i+c<=e)switch(c){case 1:a<128&&(f=a);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&a)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&a)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],s=t[i+2],h=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&h)&&(u=(15&a)<<18|(63&o)<<12|(63&s)<<6|63&h)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(t){var r=t.length;if(r<=4096)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return e}(n)}r.Buffer=u,r.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},r.INSPECT_MAX_BYTES=50,u.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(r){return!1}}(),r.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,r,e){return a(null,t,r,e)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,r,e){return function(t,r,e,n){return f(r),r<=0?h(t,r):void 0!==e?"string"==typeof n?h(t,r).fill(e,n):h(t,r).fill(e):h(t,r)}(null,t,r,e)},u.allocUnsafe=function(t){return c(null,t)},u.allocUnsafeSlow=function(t){return c(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,r){if(!u.isBuffer(t)||!u.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},u.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}},u.concat=function(t,r){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=u.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var s=t[e];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)y(this,r,r+1);return this},u.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;r<t;r+=4)y(this,r,r+3),y(this,r+1,r+2);return this},u.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;r<t;r+=8)y(this,r,r+7),y(this,r+1,r+6),y(this,r+2,r+5),y(this,r+3,r+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?R(this,0,t):_.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,r,e,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(e>>>=0)-(r>>>=0),h=Math.min(o,s),a=this.slice(n,i),f=t.slice(r,e),c=0;c<h;++c)if(a[c]!==f[c]){o=a[c],s=f[c];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},u.prototype.indexOf=function(t,r,e){return d(this,t,r,e,!0)},u.prototype.lastIndexOf=function(t,r,e){return d(this,t,r,e,!1)},u.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,t,r,e);case"utf8":case"utf-8":return v(this,t,r,e);case"ascii":return A(this,t,r,e);case"latin1":case"binary":return B(this,t,r,e);case"base64":return P(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function S(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function U(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=F(t[o]);return i}function I(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function k(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function O(t,r,e,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function Y(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function x(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function M(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function C(t,r,e,n,o){return o||M(t,0,e,4),i.write(t,r,e,n,23,4),e+4}function L(t,r,e,n,o){return o||M(t,0,e,8),i.write(t,r,e,n,52,8),e+8}u.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),u.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=u.prototype;else{var i=r-t;e=new u(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},u.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||k(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||k(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},u.prototype.readUInt8=function(t,r){return r||k(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,r){return r||k(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,r){return r||k(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,r){return r||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,r){return r||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||k(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},u.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||k(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},u.prototype.readInt8=function(t,r){return r||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,r){r||k(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt16BE=function(t,r){r||k(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt32LE=function(t,r){return r||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,r){return r||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,r){return r||k(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,r){return r||k(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,r){return r||k(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,r){return r||k(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||O(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},u.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||O(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},u.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||O(this,t,r,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},u.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||O(this,t,r,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):Y(this,t,r,!0),r+2},u.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||O(this,t,r,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):Y(this,t,r,!1),r+2},u.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||O(this,t,r,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):x(this,t,r,!0),r+4},u.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||O(this,t,r,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):x(this,t,r,!1),r+4},u.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);O(this,t,r,e,i-1,-i)}var o=0,s=1,h=0;for(this[r]=255&t;++o<e&&(s*=256);)t<0&&0===h&&0!==this[r+o-1]&&(h=1),this[r+o]=(t/s>>0)-h&255;return r+e},u.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);O(this,t,r,e,i-1,-i)}var o=e-1,s=1,h=0;for(this[r+o]=255&t;--o>=0&&(s*=256);)t<0&&0===h&&0!==this[r+o+1]&&(h=1),this[r+o]=(t/s>>0)-h&255;return r+e},u.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||O(this,t,r,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},u.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||O(this,t,r,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):Y(this,t,r,!0),r+2},u.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||O(this,t,r,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):Y(this,t,r,!1),r+2},u.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||O(this,t,r,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):x(this,t,r,!0),r+4},u.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||O(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):x(this,t,r,!1),r+4},u.prototype.writeFloatLE=function(t,r,e){return C(this,t,r,!0,e)},u.prototype.writeFloatBE=function(t,r,e){return C(this,t,r,!1,e)},u.prototype.writeDoubleLE=function(t,r,e){return L(this,t,r,!0,e)},u.prototype.writeDoubleBE=function(t,r,e){return L(this,t,r,!1,e)},u.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},u.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var s=u.isBuffer(t)?t:N(new u(t,n).toString()),h=s.length;for(o=0;o<e-r;++o)this[o+r]=s[o%h]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function F(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((e=t.charCodeAt(s))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function j(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}}).call(this,e(6))},function(t,r,e){"use strict";var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){"object"==typeof window&&(n=window)}t.exports=n},function(t,r,e){"use strict";r.byteLength=function(t){var r=a(t),e=r[0],n=r[1];return 3*(e+n)/4-n},r.toByteArray=function(t){var r,e,n=a(t),s=n[0],h=n[1],u=new o(function(t,r,e){return 3*(r+e)/4-e}(0,s,h)),f=0,c=h>0?s-4:s;for(e=0;e<c;e+=4)r=i[t.charCodeAt(e)]<<18|i[t.charCodeAt(e+1)]<<12|i[t.charCodeAt(e+2)]<<6|i[t.charCodeAt(e+3)],u[f++]=r>>16&255,u[f++]=r>>8&255,u[f++]=255&r;2===h&&(r=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,u[f++]=255&r);1===h&&(r=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,u[f++]=r>>8&255,u[f++]=255&r);return u},r.fromByteArray=function(t){for(var r,e=t.length,i=e%3,o=[],s=0,h=e-i;s<h;s+=16383)o.push(f(t,s,s+16383>h?h:s+16383));1===i?(r=t[e-1],o.push(n[r>>2]+n[r<<4&63]+"==")):2===i&&(r=(t[e-2]<<8)+t[e-1],o.push(n[r>>10]+n[r>>4&63]+n[r<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,u=s.length;h<u;++h)n[h]=s[h],i[s.charCodeAt(h)]=h;function a(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function f(t,r,e){for(var i,o,s=[],h=r;h<e;h+=3)i=(t[h]<<16&16711680)+(t[h+1]<<8&65280)+(255&t[h+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,r,e){"use strict";r.read=function(t,r,e,n,i){var o,s,h=8*i-n-1,u=(1<<h)-1,a=u>>1,f=-7,c=e?i-1:0,l=e?-1:1,p=t[r+c];for(c+=l,o=p&(1<<-f)-1,p>>=-f,f+=h;f>0;o=256*o+t[r+c],c+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[r+c],c+=l,f-=8);if(0===o)o=1-a;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=a}return(p?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,r,e,n,i,o){var s,h,u,a=8*o-i-1,f=(1<<a)-1,c=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,_=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,s=f):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),(r+=s+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=f?(h=0,s=f):s+c>=1?(h=(r*u-1)*Math.pow(2,i),s+=c):(h=r*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[e+p]=255&h,p+=g,h/=256,i-=8);for(s=s<<i|h,a+=i;a>0;t[e+p]=255&s,p+=g,s/=256,a-=8);t[e+p-g]|=128*_}},function(t,r,e){"use strict";var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,r,e){"use strict";const n=[255,254,252,248,240,224,192,128],i=[1,3,7,15,31,63,127,255];function o(t,r,e){return(t&function(t,r){return n[t]&i[Math.min(r+t-1,7)]}(r,e))>>>r}t.exports=class{constructor(t){this._value=t,this._currentBytePos=t.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+8*this._currentBytePos}totalBits(){return 8*this._value.length}take(t){let r=t,e=0;for(;r&&this._haveBits();){const t=this._value[this._currentBytePos],n=this._currentBitPos+1,i=Math.min(n,r);e=(e<<i)+o(t,n-i,i),r-=i,this._currentBitPos-=i,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return e}untake(t){for(this._currentBitPos+=t;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}}}])})); | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "hamt-sharding", | ||
"version": "0.0.2", | ||
"version": "1.0.0", | ||
"description": "JavaScript implementation of sharding using hash array mapped tries", | ||
@@ -38,3 +38,3 @@ "leadMaintainer": "Alex Potsides <alex.potsides@protocol.ai>", | ||
"devDependencies": { | ||
"aegir": "^17.0.0", | ||
"aegir": "^20.5.0", | ||
"chai": "^4.2.0", | ||
@@ -41,0 +41,0 @@ "dirty-chai": "^2.0.1" |
@@ -7,8 +7,8 @@ # hamt-sharding | ||
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) | ||
[![Jenkins](https://ci.ipfs.team/buildStatus/icon?job=IPFS%20Shipyard/js-hamt-sharding/master)](https://ci.ipfs.team/job/IPFS%20Shipyard/job/js-hamt-sharding/job/master/) | ||
[![Codecov](https://codecov.io/gh/ipfs-shipyard/js-hamt-sharding/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/js-hamt-sharding) | ||
[![Build Status](https://flat.badgen.net/travis/ipfs-shipyard/js-hamt-sharding)](https://travis-ci.com/ipfs-shipyard/js-hamt-sharding) | ||
[![Codecov](https://codecov.io/gh/ipfs-shipyard/js-hamt-sharding/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs-shipyard/js-hamt-sharding) | ||
[![Dependency Status](https://david-dm.org/ipfs-shipyard/js-hamt-sharding.svg?style=flat-square)](https://david-dm.org/ipfs/js-hamt-sharding) | ||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) | ||
![](https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square) | ||
![](https://img.shields.io/badge/Node.js-%3E%3D8.0.0-orange.svg?style=flat-square) | ||
![](https://img.shields.io/badge/Node.js-%3E%3D10.0.0-orange.svg?style=flat-square) | ||
@@ -23,5 +23,8 @@ > JavaScript implementation of hamt for use in sharding | ||
- [Install](#install) | ||
- [Usage](#usage) | ||
- [Example](#example) | ||
- [hamt-sharding](#hamt-sharding) | ||
- [Lead Maintainer](#lead-maintainer) | ||
- [Table of Contents](#table-of-contents) | ||
- [Install](#install) | ||
- [Usage](#usage) | ||
- [Example](#example) | ||
- [API](#api) | ||
@@ -41,4 +44,4 @@ - [`bucket.put(key, value)`](#bucketputkey-value) | ||
- [`hamt.isBucket(other)`](#hamtisbucketother) | ||
- [Contribute](#contribute) | ||
- [License](#license) | ||
- [Contribute](#contribute) | ||
- [License](#license) | ||
@@ -45,0 +48,0 @@ ## Install |
@@ -101,3 +101,3 @@ 'use strict' | ||
async asyncTransform (asyncMap, asyncReduce) { | ||
asyncTransform (asyncMap, asyncReduce) { | ||
return asyncTransformBucket(this, asyncMap, asyncReduce) | ||
@@ -104,0 +104,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 4 instances in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1914988
39
4587
0
181
2
90
8