@temple-wallet/wallet-address-validator
Version:
Wallet address validator for Bitcoin and other Altcoins.
1 lines • 118 kB
JavaScript
!function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).WAValidator=t()}(function(){return function n(i,o,s){function a(e,t){if(!o[e]){if(!i[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(u)return u(e,!0);throw(t=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",t}r=o[e]={exports:{}},i[e][0].call(r.exports,function(t){return a(i[e][1][t]||t)},r,r.exports,n,i,o,s)}return o[e].exports}for(var u="function"==typeof require&&require,t=0;t<s.length;t++)a(s[t]);return a}({1:[function(t,e,r){"use strict";function n(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("Wrong positive integer: "+t)}function i(t){if("boolean"!=typeof t)throw new Error("Expected boolean, not "+t)}function o(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(0<e.length&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=`+t.length)}function s(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");n(t.outputLen),n(t.blockLen)}function a(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function u(t,e){o(t);e=e.outputLen;if(t.length<e)throw new Error("digestInto() expects output buffer of length at least "+e)}Object.defineProperty(r,"__esModule",{value:!0}),r.output=r.exists=r.hash=r.bytes=r.bool=r.number=void 0,r.number=n,r.bool=i,r.bytes=o,r.hash=s,r.exists=a,r.output=u,r.default={number:n,bool:i,bytes:o,hash:s,exists:a,output:u}},{}],2:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.SHA2=void 0;const f=t("./_assert.js"),c=t("./utils.js");class n extends c.Hash{constructor(t,e,r,n){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,c.createView)(this.buffer)}update(e){f.default.exists(this);var{view:r,buffer:n,blockLen:i}=this,o=(e=(0,c.toBytes)(e)).length;for(let t=0;t<o;){var s=Math.min(i-this.pos,o-t);if(s===i)for(var a=(0,c.createView)(e);i<=o-t;t+=i)this.process(a,t);else n.set(e.subarray(t,t+s),this.pos),this.pos+=s,t+=s,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(t){f.default.exists(this),f.default.output(t,this),this.finished=!0;var{buffer:e,view:r,blockLen:n,isLE:i}=this;let o=this["pos"];e[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(r,0),o=0);for(let t=o;t<n;t++)e[t]=0;!function(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);var i=BigInt(32),o=BigInt(4294967295),i=Number(r>>i&o),r=Number(r&o),o=n?0:4;t.setUint32(e+(n?4:0),i,n),t.setUint32(e+o,r,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);var s=(0,c.createView)(t),r=this.outputLen;if(r%4)throw new Error("_sha2: outputLen should be aligned to 32bit");var a=r/4,u=this.get();if(a>u.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<a;t++)s.setUint32(4*t,u[t],i)}digest(){var{buffer:t,outputLen:e}=this,t=(this.digestInto(t),t.slice(0,e));return this.destroy(),t}_cloneInto(t){(t=t||new this.constructor).set(...this.get());var{blockLen:e,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return t.length=n,t.pos=s,t.finished=i,t.destroyed=o,n%e&&t.buffer.set(r),t}}r.SHA2=n},{"./_assert.js":1,"./utils.js":5}],3:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.crypto=void 0,r.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},{}],4:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.sha224=r.sha256=void 0;var n=t("./_sha2.js");const w=t("./utils.js"),v=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),b=new Uint32Array(64);class o extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|i[0],this.B=0|i[1],this.C=0|i[2],this.D=0|i[3],this.E=0|i[4],this.F=0|i[5],this.G=0|i[6],this.H=0|i[7]}get(){var{A:t,B:e,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[t,e,r,n,i,o,s,a]}set(t,e,r,n,i,o,s,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,r){for(let t=0;t<16;t++,r+=4)b[t]=e.getUint32(r,!1);for(let t=16;t<64;t++){var n=b[t-15],i=b[t-2],n=(0,w.rotr)(n,7)^(0,w.rotr)(n,18)^n>>>3,i=(0,w.rotr)(i,17)^(0,w.rotr)(i,19)^i>>>10;b[t]=i+b[t-7]+n+b[t-16]|0}let{A:o,B:s,C:a,D:u,E:f,F:c,G:h,H:l}=this;for(let t=0;t<64;t++){var d=(0,w.rotr)(f,6)^(0,w.rotr)(f,11)^(0,w.rotr)(f,25),p=l+d+(d=f,p=c,g=h,d&p^~d&g)+v[t]+b[t]|0,d=((0,w.rotr)(o,2)^(0,w.rotr)(o,13)^(0,w.rotr)(o,22))+(d=o,g=s,y=a,d&g^d&y^g&y)|0;l=h,h=c,c=f,f=u+p|0,u=a,a=s,s=o,o=p+d|0}var y,p,g;o=o+this.A|0,s=s+this.B|0,a=a+this.C|0,u=u+this.D|0,f=f+this.E|0,c=c+this.F|0,h=h+this.G|0,l=l+this.H|0,this.set(o,s,a,u,f,c,h,l)}roundClean(){b.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class s extends o{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}r.sha256=(0,w.wrapConstructor)(()=>new o),r.sha224=(0,w.wrapConstructor)(()=>new s)},{"./_sha2.js":2,"./utils.js":5}],5:[function(t,e,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.randomBytes=s.wrapXOFConstructorWithOpts=s.wrapConstructorWithOpts=s.wrapConstructor=s.checkOpts=s.Hash=s.concatBytes=s.toBytes=s.utf8ToBytes=s.asyncLoop=s.nextTick=s.hexToBytes=s.bytesToHex=s.isLE=s.rotr=s.createView=s.u32=s.u8=void 0;const r=t("@noble/hashes/crypto"),n=t=>t instanceof Uint8Array;s.u8=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s.u32=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),s.createView=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);if(s.rotr=(t,e)=>t<<32-e|t>>>e,s.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!s.isLE)throw new Error("Non little-endian hardware is not supported");const i=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));s.bytesToHex=function(e){if(!n(e))throw new Error("Uint8Array expected");let r="";for(let t=0;t<e.length;t++)r+=i[e[t]];return r},s.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);var t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);var r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){var n=2*t,n=e.slice(n,2+n),n=Number.parseInt(n,16);if(Number.isNaN(n)||n<0)throw new Error("Invalid byte sequence");r[t]=n}return r};function o(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))}function a(t){if("string"==typeof t&&(t=o(t)),n(t))return t;throw new Error("expected Uint8Array, got "+typeof t)}s.nextTick=async()=>{},s.asyncLoop=async function(e,r,n){let i=Date.now();for(let t=0;t<e;t++){n(t);var o=Date.now()-i;0<=o&&o<r||(await(0,s.nextTick)(),i+=o)}},s.utf8ToBytes=o,s.toBytes=a,s.concatBytes=function(...t){const e=new Uint8Array(t.reduce((t,e)=>t+e.length,0));let r=0;return t.forEach(t=>{if(!n(t))throw new Error("Uint8Array expected");e.set(t,r),r+=t.length}),e};s.Hash=class{clone(){return this._cloneInto()}};s.checkOpts=function(t,e){var r;if(void 0===e||"object"==typeof e&&(r=e,"[object Object]"===Object.prototype.toString.call(r))&&r.constructor===Object)return Object.assign(t,e);throw new Error("Options should be object or undefined")},s.wrapConstructor=function(e){var t=t=>e().update(a(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},s.wrapConstructorWithOpts=function(r){var t=(t,e)=>r(e).update(a(t)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=t=>r(t),t},s.wrapXOFConstructorWithOpts=function(r){var t=(t,e)=>r(e).update(a(t)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=t=>r(t),t},s.randomBytes=function(t=32){if(r.crypto&&"function"==typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}},{"@noble/hashes/crypto":3}],6:[function(t,e,r){"use strict";var v=t("safe-buffer").Buffer;e.exports=function(l){if(255<=l.length)throw new TypeError("Alphabet too long");for(var d=new Uint8Array(256),t=0;t<d.length;t++)d[t]=255;for(var e=0;e<l.length;e++){var r=l.charAt(e),n=r.charCodeAt(0);if(255!==d[n])throw new TypeError(r+" is ambiguous");d[n]=e}var p=l.length,y=l.charAt(0),g=Math.log(p)/Math.log(256),w=Math.log(256)/Math.log(p);function i(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return v.alloc(0);for(var e=0,r=0,n=0;t[e]===y;)r++,e++;for(var i=(t.length-e)*g+1>>>0,o=new Uint8Array(i);e<t.length;){var s=t.charCodeAt(e);if(255<s)return;var a=d[s];if(255===a)return;for(var u=0,f=i-1;(0!==a||u<n)&&-1!==f;f--,u++)a+=p*o[f]>>>0,o[f]=a%256>>>0,a=a/256>>>0;if(0!==a)throw new Error("Non-zero carry");n=u,e++}for(var c=i-n;c!==i&&0===o[c];)c++;for(var h=v.allocUnsafe(r+(i-c)),l=(h.fill(0,0,r),r);c!==i;)h[l++]=o[c++];return h}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=v.from(t)),!v.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var e=0,r=0,n=0,i=t.length;n!==i&&0===t[n];)n++,e++;for(var o=(i-n)*w+1>>>0,s=new Uint8Array(o);n!==i;){for(var a=t[n],u=0,f=o-1;(0!==a||u<r)&&-1!==f;f--,u++)a+=256*s[f]>>>0,s[f]=a%p>>>0,a=a/p>>>0;if(0!==a)throw new Error("Non-zero carry");r=u,n++}for(var c=o-r;c!==o&&0===s[c];)c++;for(var h=y.repeat(e);c<o;++c)h+=l.charAt(s[c]);return h},decodeUnsafe:i,decode:function(t){if(t=i(t))return t;throw new Error("Non-base"+p+" character")}}}},{"safe-buffer":41}],7:[function(t,e,r){"use strict";r.byteLength=function(t){var t=c(t),e=t[0],t=t[1];return 3*(e+t)/4-t},r.toByteArray=function(t){for(var e,r=c(t),n=r[0],r=r[1],i=new f(function(t,e){return 3*(t+e)/4-e}(n,r)),o=0,s=0<r?n-4:n,a=0;a<s;a+=4)e=u[t.charCodeAt(a)]<<18|u[t.charCodeAt(a+1)]<<12|u[t.charCodeAt(a+2)]<<6|u[t.charCodeAt(a+3)],i[o++]=e>>16&255,i[o++]=e>>8&255,i[o++]=255&e;2===r&&(e=u[t.charCodeAt(a)]<<2|u[t.charCodeAt(a+1)]>>4,i[o++]=255&e);1===r&&(e=u[t.charCodeAt(a)]<<10|u[t.charCodeAt(a+1)]<<4|u[t.charCodeAt(a+2)]>>2,i[o++]=e>>8&255,i[o++]=255&e);return i},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,i=[],o=0,s=r-n;o<s;o+=16383)i.push(function(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(function(t){return a[t>>18&63]+a[t>>12&63]+a[t>>6&63]+a[63&t]}(n));return i.join("")}(t,o,s<o+16383?s:o+16383));1==n?(e=t[r-1],i.push(a[e>>2]+a[e<<4&63]+"==")):2==n&&(e=(t[r-2]<<8)+t[r-1],i.push(a[e>>10]+a[e>>4&63]+a[e<<2&63]+"="));return i.join("")};for(var a=[],u=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)a[i]=n[i],u[n.charCodeAt(i)]=i;function c(t){var e=t.length;if(0<e%4)throw new Error("Invalid string. Length must be a multiple of 4");t=t.indexOf("="),e=(t=-1===t?e:t)===e?0:4-t%4;return[t,e]}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],8:[function(t,e,r){t=t("base-x");e.exports=t("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},{"base-x":9}],9:[function(t,e,r){"use strict";e.exports=function(l){if(255<=l.length)throw new TypeError("Alphabet too long");for(var d=new Uint8Array(256),t=0;t<d.length;t++)d[t]=255;for(var e=0;e<l.length;e++){var r=l.charAt(e),n=r.charCodeAt(0);if(255!==d[n])throw new TypeError(r+" is ambiguous");d[n]=e}var p=l.length,y=l.charAt(0),g=Math.log(p)/Math.log(256),w=Math.log(256)/Math.log(p);function i(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return new Uint8Array;for(var e=0,r=0,n=0;t[e]===y;)r++,e++;for(var i=(t.length-e)*g+1>>>0,o=new Uint8Array(i);t[e];){var s=t.charCodeAt(e);if(255<s)return;var a=d[s];if(255===a)return;for(var u=0,f=i-1;(0!==a||u<n)&&-1!==f;f--,u++)a+=p*o[f]>>>0,o[f]=a%256>>>0,a=a/256>>>0;if(0!==a)throw new Error("Non-zero carry");n=u,e++}for(var c=i-n;c!==i&&0===o[c];)c++;for(var h=new Uint8Array(r+(i-c)),l=r;c!==i;)h[l++]=o[c++];return h}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var e=0,r=0,n=0,i=t.length;n!==i&&0===t[n];)n++,e++;for(var o=(i-n)*w+1>>>0,s=new Uint8Array(o);n!==i;){for(var a=t[n],u=0,f=o-1;(0!==a||u<r)&&-1!==f;f--,u++)a+=256*s[f]>>>0,s[f]=a%p>>>0,a=a/p>>>0;if(0!==a)throw new Error("Non-zero carry");r=u,n++}for(var c=o-r;c!==o&&0===s[c];)c++;for(var h=y.repeat(e);c<o;++c)h+=l.charAt(s[c]);return h},decodeUnsafe:i,decode:function(t){if(t=i(t))return t;throw new Error("Non-base"+p+" character")}}}},{}],10:[function(t,e,r){"use strict";var o=t("bs58");e.exports=function(i){function e(t){var e=t.slice(0,-4),t=t.slice(-4),r=i(e);if(!(t[0]^r[0]|t[1]^r[1]|t[2]^r[2]|t[3]^r[3]))return e}return{encode:function(t){var t=Uint8Array.from(t),e=i(t),r=t.length+4,n=new Uint8Array(r);return n.set(t,0),n.set(e.subarray(0,4),t.length),o.encode(n,r)},decode:function(t){if(t=e(o.decode(t)))return t;throw new Error("Invalid checksum")},decodeUnsafe:function(t){if(t=o.decodeUnsafe(t))return e(t)}}}},{bs58:8}],11:[function(t,e,r){"use strict";var n=t("@noble/hashes/sha256")["sha256"],t=t("./base");e.exports=t(function(t){return n(n(t))})},{"./base":10,"@noble/hashes/sha256":4}],12:[function(t,e,r){"use strict";var U=t("base64-js"),o=t("ieee754"),n=(r.Buffer=h,r.SlowBuffer=function(t){+t!=t&&(t=0);return h.alloc(+t)},r.INSPECT_MAX_BYTES=50,2147483647);function u(t){if(n<t)throw new RangeError('The value "'+t+'" is invalid for option "size"');t=new Uint8Array(t);return t.__proto__=h.prototype,t}function h(t,e,r){if("number"!=typeof t)return i(t,e,r);if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return a(t)}function i(t,e,r){if("string"==typeof t){var n=t,i=e;if(h.isEncoding(i="string"==typeof i&&""!==i?i:"utf8"))return o=0|l(n,i),s=u(o),s=(n=s.write(n,i))!==o?s.slice(0,n):s;throw new TypeError("Unknown encoding: "+i)}if(ArrayBuffer.isView(t))return f(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(I(t,ArrayBuffer)||t&&I(t.buffer,ArrayBuffer)){var o=t,n=e,s=r;if(n<0||o.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(o.byteLength<n+(s||0))throw new RangeError('"length" is outside of buffer bounds');return(o=void 0===n&&void 0===s?new Uint8Array(o):void 0===s?new Uint8Array(o,n):new Uint8Array(o,n,s)).__proto__=h.prototype,o}if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return h.from(i,e,r);var a=function(t){{var e,r;if(h.isBuffer(t))return e=0|c(t.length),0!==(r=u(e)).length&&t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||L(t.length)?u(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}(t);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return h.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(t){return s(t),u(t<0?0:0|c(t))}function f(t){for(var e=t.length<0?0:0|c(t.length),r=u(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function c(t){if(n<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function l(t,e){if(h.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||I(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=2<arguments.length&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return T(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return C(t).length;default:if(i)return n?-1:T(t).length;e=(""+e).toLowerCase(),i=!0}}function d(t,e,r){var n,i=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":var o=this,s=e,a=r,u=o.length;(!a||a<0||u<a)&&(a=u);for(var f="",c=s=!s||s<0?0:s;c<a;++c)f+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(o[c]);return f;case"utf8":case"utf-8":return x(this,e,r);case"ascii":var h=this,u=e,l=r,d="";l=Math.min(h.length,l);for(var p=u;p<l;++p)d+=String.fromCharCode(127&h[p]);return d;case"latin1":case"binary":var y=this,s=e,g=r,w="";g=Math.min(y.length,g);for(var v=s;v<g;++v)w+=String.fromCharCode(y[v]);return w;case"base64":return b=this,n=r,0===(m=e)&&n===b.length?U.fromByteArray(b):U.fromByteArray(b.slice(m,n));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var b=e,m=r,A=this.slice(b,m),_="",E=0;E<A.length;E+=2)_+=String.fromCharCode(A[E]+256*A[E+1]);return _;default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),(r=(r=L(r=+r)?i?0:t.length-1:r)<0?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=h.from(e,n)),h.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,r):g(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,i){var o=1,s=t.length,a=e.length;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;s/=o=2,a/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i)for(var f=-1,c=r;c<s;c++)if(u(t,c)===u(e,-1===f?0:c-f)){if(c-(f=-1===f?c:f)+1===a)return f*o}else-1!==f&&(c-=c-f),f=-1;else for(c=r=s<r+a?s-a:r;0<=c;c--){for(var h=!0,l=0;l<a;l++)if(u(t,c+l)!==u(e,l)){h=!1;break}if(h)return c}return-1}function w(t,e,r,n){return S(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function v(t,e,r,n){return S(function(t,e){for(var r,n,i=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,i.push(r%256),i.push(n);return i}(e,t.length-r),t,r,n)}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,f=t[i],c=null,h=239<f?4:223<f?3:191<f?2:1;if(i+h<=r)switch(h){case 1:f<128&&(c=f);break;case 2:128==(192&(o=t[i+1]))&&127<(u=(31&f)<<6|63&o)&&(c=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&2047<(u=(15&f)<<12|(63&o)<<6|63&s)&&(u<55296||57343<u)&&(c=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&65535<(u=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&a)&&u<1114112&&(c=u)}null===c?(c=65533,h=1):65535<c&&(n.push((c-=65536)>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}var l=n,d=l.length;if(d<=b)return String.fromCharCode.apply(String,l);for(var p="",y=0;y<d;)p+=String.fromCharCode.apply(String,l.slice(y,y+=b));return p}r.kMaxLength=n,(h.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),h.poolSize=8192,h.from=i,h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,h.alloc=function(t,e,r){return e=e,r=r,s(t=t),!(t<=0)&&void 0!==e?"string"==typeof r?u(t).fill(e,r):u(t).fill(e):u(t)},h.allocUnsafe=a,h.allocUnsafeSlow=a,h.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==h.prototype},h.compare=function(t,e){if(I(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),I(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},h.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}},h.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return h.alloc(0);if(void 0===e)for(i=e=0;i<t.length;++i)e+=t[i].length;for(var r=h.allocUnsafe(e),n=0,i=0;i<t.length;++i){var o=t[i];if(I(o,Uint8Array)&&(o=h.from(o)),!h.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,n),n+=o.length}return r},h.byteLength=l,h.prototype._isBuffer=!0,h.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 e=0;e<t;e+=2)p(this,e,e+1);return this},h.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 e=0;e<t;e+=4)p(this,e,e+3),p(this,e+1,e+2);return this},h.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 e=0;e<t;e+=8)p(this,e,e+7),p(this,e+1,e+6),p(this,e+2,e+5),p(this,e+3,e+4);return this},h.prototype.toLocaleString=h.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?x(this,0,t):d.apply(this,arguments)},h.prototype.equals=function(t){if(h.isBuffer(t))return this===t||0===h.compare(this,t);throw new TypeError("Argument must be a Buffer")},h.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES,t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim();return this.length>e&&(t+=" ... "),"<Buffer "+t+">"},h.prototype.compare=function(t,e,r,n,i){if(I(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),!h.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),(e=void 0===e?0:e)<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=e)return 0;if(i<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(n,i),f=t.slice(e,r),c=0;c<a;++c)if(u[c]!==f[c]){o=u[c],s=f[c];break}return o<s?-1:s<o?1:0},h.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},h.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},h.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},h.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||i<r)&&(r=i),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,s,a,u=!1;;)switch(n){case"hex":var f=this,c=t,h=e,l=r,d=(h=Number(h)||0,f.length-h);(!l||d<(l=Number(l)))&&(l=d),(d=c.length)/2<l&&(l=d/2);for(var p=0;p<l;++p){var y=parseInt(c.substr(2*p,2),16);if(L(y))return p;f[h+p]=y}return p;case"utf8":case"utf-8":return d=e,a=r,S(T(t,(s=this).length-d),s,d,a);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return s=this,a=e,o=r,S(C(t),s,a,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,t,e,r);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var b=4096;function m(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(r<t+e)throw new RangeError("Trying to access beyond buffer length")}function A(t,e,r,n,i,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<e||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function _(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function E(t,e,r,n,i){return e=+e,r>>>=0,i||_(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,i){return e=+e,r>>>=0,i||_(t,0,r,8),o.write(t,e,r,n,52,8),r+8}h.prototype.slice=function(t,e){var r=this.length,r=((t=~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),e<t&&(e=t),this.subarray(t,e));return r.__proto__=h.prototype,r},h.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||m(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},h.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||m(t,e,this.length);for(var n=this[t+--e],i=1;0<e&&(i*=256);)n+=this[t+--e]*i;return n},h.prototype.readUInt8=function(t,e){return t>>>=0,e||m(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return t>>>=0,e||m(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return t>>>=0,e||m(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return t>>>=0,e||m(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return t>>>=0,e||m(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||m(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return(i*=128)<=n&&(n-=Math.pow(2,8*e)),n},h.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||m(t,e,this.length);for(var n=e,i=1,o=this[t+--n];0<n&&(i*=256);)o+=this[t+--n]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*e)),o},h.prototype.readInt8=function(t,e){return t>>>=0,e||m(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){t>>>=0,e||m(t,2,this.length);e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},h.prototype.readInt16BE=function(t,e){t>>>=0,e||m(t,2,this.length);e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},h.prototype.readInt32LE=function(t,e){return t>>>=0,e||m(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return t>>>=0,e||m(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return t>>>=0,e||m(t,4,this.length),o.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return t>>>=0,e||m(t,4,this.length),o.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return t>>>=0,e||m(t,8,this.length),o.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return t>>>=0,e||m(t,8,this.length),o.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||A(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},h.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||A(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;0<=--i&&(o*=256);)this[e+i]=t/o&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,1,255,0),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeIntLE=function(t,e,r,n){t=+t,e>>>=0,n||A(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},h.prototype.writeIntBE=function(t,e,r,n){t=+t,e>>>=0,n||A(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var i=r-1,o=1,s=0;for(this[e+i]=255&t;0<=--i&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,1,127,-128),this[e]=255&(t=t<0?255+t+1:t),e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,2147483647,-2147483648),this[e]=(t=t<0?4294967295+t+1:t)>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeFloatLE=function(t,e,r){return E(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return E(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,n){if(!h.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),e>=t.length&&(e=t.length),(n=0<n&&n<r?r:n)===r)return 0;if(0===t.length||0===this.length)return 0;if((e=e||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var i=(n=t.length-e<n-r?t.length-e+r:n)-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var o=i-1;0<=o;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},h.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!h.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i;1===t.length&&(i=t.charCodeAt(0),"utf8"===n&&i<128||"latin1"===n)&&(t=i)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");var o;if(!(r<=e))if(e>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(o=e;o<r;++o)this[o]=t;else{var s=h.isBuffer(t)?t:h.from(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var k=/[^+/0-9A-Za-z-_]/g;function T(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&r<57344){if(!i){if(56319<r){-1<(e-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&o.push(239,191,189);continue}i=r;continue}if(r<56320){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,r<128){if(--e<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 C(t){return U.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function S(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 I(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function L(t){return t!=t}},{"base64-js":7,ieee754:38}],13:[function(t,e,r){"use strict";e.exports=t("./es6/crc1").default},{"./es6/crc1":24}],14:[function(t,e,r){"use strict";e.exports=t("./es6/crc16").default},{"./es6/crc16":25}],15:[function(t,e,r){"use strict";e.exports=t("./es6/crc16ccitt").default},{"./es6/crc16ccitt":26}],16:[function(t,e,r){"use strict";e.exports=t("./es6/crc16kermit").default},{"./es6/crc16kermit":27}],17:[function(t,e,r){"use strict";e.exports=t("./es6/crc16modbus").default},{"./es6/crc16modbus":28}],18:[function(t,e,r){"use strict";e.exports=t("./es6/crc16xmodem").default},{"./es6/crc16xmodem":29}],19:[function(t,e,r){"use strict";e.exports=t("./es6/crc24").default},{"./es6/crc24":30}],20:[function(t,e,r){"use strict";e.exports=t("./es6/crc32").default},{"./es6/crc32":31}],21:[function(t,e,r){"use strict";e.exports=t("./es6/crc8").default},{"./es6/crc8":32}],22:[function(t,e,r){"use strict";e.exports=t("./es6/crc81wire").default},{"./es6/crc81wire":33}],23:[function(t,e,r){"use strict";e.exports=t("./es6/crcjam").default},{"./es6/crcjam":34}],24:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("buffer"),o=n(t("./create_buffer"));function n(t){return t&&t.__esModule?t:{default:t}}t=(0,n(t("./define_crc")).default)("crc1",function(t,e){i.Buffer.isBuffer(t)||(t=(0,o.default)(t));for(var e=~~e,r=0,n=0;n<t.length;n++)r+=t[n];return(e+=r%256)%256});r.default=t},{"./create_buffer":35,"./define_crc":36,buffer:12}],25:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=t("buffer"),s=n(t("./create_buffer")),t=n(t("./define_crc"));function n(t){return t&&t.__esModule?t:{default:t}}var a=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448],t=("undefined"!=typeof Int32Array&&(a=new Int32Array(a)),(0,t.default)("crc-16",function(t,e){o.Buffer.isBuffer(t)||(t=(0,s.default)(t));for(var r=~~e,n=0;n<t.length;n++)var i=t[n],r=65535&(a[255&(r^i)]^r>>8);return r}));r.default=t},{"./create_buffer":35,"./define_crc":36,buffer:12}],26:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=t("buffer"),s=n(t("./create_buffer")),t=n(t("./define_crc"));function n(t){return t&&t.__esModule?t:{default:t}}var a=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],t=("undefined"!=typeof Int32Array&&(a=new Int32Array(a)),(0,t.default)("ccitt",function(t,e){o.Buffer.isBuffer(t)||(t=(0,s.default)(t));for(var r=void 0!==e?~~e:65535,n=0;n<t.length;n++)var i=t[n],r=65535&(a[255&(r>>8^i)]^r<<8);return r}));r.default=t},{"./create_buffer":35,"./define_crc":36,buffer:12}],27:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=t("buffer"),s=n(t("./create_buffer")),t=n(t("./define_crc"));function n(t){return t&&t.__esModule?t:{default:t}}var a=[0,4489,8978,12955,17956,22445,25910,29887,35912,40385,44890,48851,51820,56293,59774,63735,4225,264,13203,8730,22181,18220,30135,25662,40137,36160,49115,44626,56045,52068,63999,59510,8450,12427,528,5017,26406,30383,17460,21949,44362,48323,36440,40913,60270,64231,51324,55797,12675,8202,4753,792,30631,26158,21685,17724,48587,44098,40665,36688,64495,60006,55549,51572,16900,21389,24854,28831,1056,5545,10034,14011,52812,57285,60766,64727,34920,39393,43898,47859,21125,17164,29079,24606,5281,1320,14259,9786,57037,53060,64991,60502,39145,35168,48123,43634,25350,29327,16404,20893,9506,13483,1584,6073,61262,65223,52316,56789,43370,47331,35448,39921,29575,25102,20629,16668,13731,9258,5809,1848,65487,60998,56541,52564,47595,43106,39673,35696,33800,38273,42778,46739,49708,54181,57662,61623,2112,6601,11090,15067,20068,24557,28022,31999,38025,34048,47003,42514,53933,49956,61887,57398,6337,2376,15315,10842,24293,20332,32247,27774,42250,46211,34328,38801,58158,62119,49212,53685,10562,14539,2640,7129,28518,32495,19572,24061,46475,41986,38553,34576,62383,57894,53437,49460,14787,10314,6865,2904,32743,28270,23797,19836,50700,55173,58654,62615,32808,37281,41786,45747,19012,23501,26966,30943,3168,7657,12146,16123,54925,50948,62879,58390,37033,33056,46011,41522,23237,19276,31191,26718,7393,3432,16371,11898,59150,63111,50204,54677,41258,45219,33336,37809,27462,31439,18516,23005,11618,15595,3696,8185,63375,58886,54429,50452,45483,40994,37561,33584,31687,27214,22741,18780,15843,11370,7921,3960],t=("undefined"!=typeof Int32Array&&(a=new Int32Array(a)),(0,t.default)("kermit",function(t,e){o.Buffer.isBuffer(t)||(t=(0,s.default)(t));for(var r=void 0!==e?~~e:0,n=0;n<t.length;n++)var i=t[n],r=65535&(a[255&(r^i)]^r>>8);return r}));r.default=t},{"./create_buffer":35,"./define_crc":36,buffer:12}],28:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=t("buffer"),s=n(t("./create_buffer")),t=n(t("./define_crc"));function n(t){return t&&t.__esModule?t:{default:t}}var a=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448],t=("undefined"!=typeof Int32Array&&(a=new Int32Array(a)),(0,t.default)("crc-16-modbus",function(t,e){o.Buffer.isBuffer(t)||(t=(0,s.default)(t));for(var r=void 0!==e?~~e:65535,n=0;n<t.length;n++)var i=t[n],r=65535&(a[255&(r^i)]^r>>8);return r}));r.default=t},{"./create_buffer":35,"./define_crc":36,buffer:12}],29:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=t("buffer"),s=n(t("./create_buffer"));function n(t){return t&&t.__esModule?t:{default:t}}t=(0,n(t("./define_crc")).default)("xmodem",function(t,e){o.Buffer.isBuffer(t)||(t=(0,s.default)(t));for(var r=void 0!==e?~~e:0,n=0;n<t.length;n++){var i=r>>>8&255,r=r<<8&65535;r=(r^=i=(i^=255&t[n])^i>>>4)^(i=i<<5&65535)^(i=i<<7&65535)}return r});r.default=t},{"./create_buffer":35,"./define_crc":36,buffer:12}],30:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=t("buffer"),s=n(t("./create_buffer")),t=n(t("./define_crc"));function n(t){return t&&t.__esModule?t:{default:t}}var a=[0,8801531,9098509,825846,9692897,1419802,1651692,10452759,10584377,2608578,2839604,11344079,3303384,11807523,12104405,4128302,12930697,4391538,5217156,13227903,5679208,13690003,14450021,5910942,6606768,14844747,15604413,6837830,16197969,7431594,8256604,16494759,840169,9084178,8783076,18463,10434312,1670131,1434117,9678590,11358416,2825259,2590173,10602790,4109873,12122826,11821884,3289031,13213536,5231515,4409965,12912278,5929345,14431610,13675660,5693559,6823513,15618722,14863188,6588335,16513208,8238147,7417269,16212302,1680338,10481449,9664223,1391140,9061683,788936,36926,8838341,12067563,4091408,3340262,11844381,2868234,11372785,10555655,2579964,14478683,5939616,5650518,13661357,5180346,13190977,12967607,4428364,8219746,16457881,16234863,7468436,15633027,6866552,6578062,14816117,1405499,9649856,10463030,1698765,8819930,55329,803287,9047340,11858690,3325945,4072975,12086004,2561507,10574104,11387118,2853909,13647026,5664841,5958079,14460228,4446803,12949160,13176670,5194661,7454091,16249200,16476294,8201341,14834538,6559633,6852199,15647388,3360676,11864927,12161705,4185682,10527045,2551230,2782280,11286707,9619101,1346150,1577872,10379115,73852,8875143,9172337,899466,16124205,7357910,8182816,16421083,6680524,14918455,15678145,6911546,5736468,13747439,14507289,5968354,12873461,4334094,5159928,13170435,4167245,12180150,11879232,3346363,11301036,2767959,2532769,10545498,10360692,1596303,1360505,9604738,913813,9157998,8856728,92259,16439492,8164415,7343561,16138546,6897189,15692510,14936872,6662099,5986813,14488838,13733104,5750795,13156124,5174247,4352529,12855018,2810998,11315341,10498427,2522496,12124823,4148844,3397530,11901793,9135439,862644,110658,8912057,1606574,10407765,9590435,1317464,15706879,6940164,6651890,14889737,8145950,16384229,16161043,7394792,5123014,13133629,12910283,4370992,14535975,5997020,5707818,13718737,2504095,10516836,11329682,2796649,11916158,3383173,4130419,12143240,8893606,129117,876971,9121104,1331783,9576124,10389322,1625009,14908182,6633453,6925851,15721184,7380471,16175372,16402682,8127489,4389423,12891860,13119266,5137369,13704398,5722165,6015427,14517560],t=("undefined"!=typeof Int32Array&&(a=new Int32Array(a)),(0,t.default)("crc-24",function(t,e){o.Buffer.isBuffer(t)||(t=(0,s.default)(t));for(var r=void 0!==e?~~e:11994318,n=0;n<t.length;n++)var i=t[n],r=16777215&(a[255&(r>>16^i)]^r<<8);return r}));r.default=t},{"./create_buffer":35,"./define_crc":36,buffer:12}],31:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=t("buffer"),s=n(t("./create_buffer")),t=n(t("./define_crc"));function n(t){return t&&t.__esModule?t:{default:t}}var a=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],t=("undefined"!=typeof Int32Array&&(a=new Int32Array(a)),(0,t.default)("crc-32",function(t,e){o.Buffer.isBuffer(t)||(t=(0,s.default)(t));for(var r=0===e?0:-1^~~e,n=0;n<t.length;n++)var i=t[n],r=a[255&(r^i)]^r>>>8;return-1^r}));r.default=t},{"./creat