diff --git a/dist/wallet-address-validator.js b/dist/wallet-address-validator.js index ee80d948..e2996f97 100644 --- a/dist/wallet-address-validator.js +++ b/dist/wallet-address-validator.js @@ -10,7 +10,9 @@ var _Buffer = require('safe-buffer').Buffer function base (ALPHABET) { if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } var BASE_MAP = new Uint8Array(256) - BASE_MAP.fill(255) + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255 + } for (var i = 0; i < ALPHABET.length; i++) { var x = ALPHABET.charAt(i) var xc = x.charCodeAt(0) @@ -22,6 +24,7 @@ function base (ALPHABET) { var FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up var iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up function encode (source) { + if (Array.isArray(source) || source instanceof Uint8Array) { source = _Buffer.from(source) } if (!_Buffer.isBuffer(source)) { throw new TypeError('Expected Buffer') } if (source.length === 0) { return '' } // Skip & count leading zeroes. @@ -120,7 +123,7 @@ function base (ALPHABET) { } module.exports = base -},{"safe-buffer":123}],2:[function(require,module,exports){ +},{"safe-buffer":35}],2:[function(require,module,exports){ 'use strict' exports.byteLength = byteLength @@ -5217,253 +5220,147 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { defined in FIPS PUB 180-4 and FIPS PUB 202, as well as the corresponding HMAC implementation as defined in FIPS PUB 198a - Copyright Brian Turek 2008-2017 + Copyright 2008-2020 Brian Turek, 1998-2009 Paul Johnston & Contributors Distributed under the BSD License See http://caligatio.github.com/jsSHA/ for more information - - Several functions taken from Paul Johnston */ -'use strict';(function(I){function w(c,a,d){var l=0,b=[],g=0,f,n,k,e,h,q,y,p,m=!1,t=[],r=[],u,z=!1;d=d||{};f=d.encoding||"UTF8";u=d.numRounds||1;if(u!==parseInt(u,10)||1>u)throw Error("numRounds must a integer >= 1");if(0===c.lastIndexOf("SHA-",0))if(q=function(b,a){return A(b,a,c)},y=function(b,a,l,f){var g,e;if("SHA-224"===c||"SHA-256"===c)g=(a+65>>>9<<4)+15,e=16;else throw Error("Unexpected error in SHA-2 implementation");for(;b.length<=g;)b.push(0);b[a>>>5]|=128<<24-a%32;a=a+l;b[g]=a&4294967295; -b[g-1]=a/4294967296|0;l=b.length;for(a=0;a>>3;g=e/4-1;if(eb/8){for(;a.length<=g;)a.push(0);a[g]&=4294967040}for(b=0;b<=g;b+=1)t[b]=a[b]^909522486,r[b]=a[b]^1549556828;n=q(t,n);l=h;m=!0};this.update=function(a){var c,f,e,d=0,p=h>>>5;c=k(a,b,g);a=c.binLen;f=c.value;c=a>>>5;for(e=0;e>> -5);g=a%h;z=!0};this.getHash=function(a,f){var d,h,k,q;if(!0===m)throw Error("Cannot call getHash after setting HMAC key");k=C(f);switch(a){case "HEX":d=function(a){return D(a,e,k)};break;case "B64":d=function(a){return E(a,e,k)};break;case "BYTES":d=function(a){return F(a,e)};break;case "ARRAYBUFFER":try{h=new ArrayBuffer(0)}catch(v){throw Error("ARRAYBUFFER not supported by this environment");}d=function(a){return G(a,e)};break;default:throw Error("format must be HEX, B64, BYTES, or ARRAYBUFFER"); -}q=y(b.slice(),g,l,p(n));for(h=1;h>>2]>>>8*(3+b%4*-1),l+="0123456789abcdef".charAt(g>>>4&15)+"0123456789abcdef".charAt(g&15);return d.outputUpper?l.toUpperCase():l}function E(c,a,d){var l="",b=a/8,g,f,n;for(g=0;g>>2]:0,n=g+2>>2]:0,n=(c[g>>>2]>>>8*(3+g%4*-1)&255)<<16|(f>>>8*(3+(g+1)%4*-1)&255)<<8|n>>>8*(3+(g+2)%4*-1)&255,f=0;4>f;f+=1)8*g+6*f<=a?l+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n>>> -6*(3-f)&63):l+=d.b64Pad;return l}function F(c,a){var d="",l=a/8,b,g;for(b=0;b>>2]>>>8*(3+b%4*-1)&255,d+=String.fromCharCode(g);return d}function G(c,a){var d=a/8,l,b=new ArrayBuffer(d),g;g=new Uint8Array(b);for(l=0;l>>2]>>>8*(3+l%4*-1)&255;return b}function C(c){var a={outputUpper:!1,b64Pad:"=",shakeLen:-1};c=c||{};a.outputUpper=c.outputUpper||!1;!0===c.hasOwnProperty("b64Pad")&&(a.b64Pad=c.b64Pad);if("boolean"!==typeof a.outputUpper)throw Error("Invalid outputUpper formatting option"); -if("string"!==typeof a.b64Pad)throw Error("Invalid b64Pad formatting option");return a}function B(c,a){var d;switch(a){case "UTF8":case "UTF16BE":case "UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE");}switch(c){case "HEX":d=function(a,b,c){var f=a.length,d,k,e,h,q;if(0!==f%2)throw Error("String of HEX type must be in byte increments");b=b||[0];c=c||0;q=c>>>3;for(d=0;d>>1)+q;for(e=h>>>2;b.length<=e;)b.push(0);b[e]|=k<<8*(3+h%4*-1)}return{value:b,binLen:4*f+c}};break;case "TEXT":d=function(c,b,d){var f,n,k=0,e,h,q,m,p,r;b=b||[0];d=d||0;q=d>>>3;if("UTF8"===a)for(r=3,e=0;ef?n.push(f):2048>f?(n.push(192|f>>>6),n.push(128|f&63)):55296>f||57344<=f?n.push(224|f>>>12,128|f>>>6&63,128|f&63):(e+=1,f=65536+((f&1023)<<10|c.charCodeAt(e)&1023),n.push(240|f>>>18,128|f>>>12&63,128|f>>>6&63,128|f&63)),h=0;h>>2;b.length<=m;)b.push(0);b[m]|=n[h]<<8*(r+p%4*-1);k+=1}else if("UTF16BE"===a||"UTF16LE"===a)for(r=2,n="UTF16LE"===a&&!0||"UTF16LE"!==a&&!1,e=0;e>>8);p=k+q;for(m=p>>>2;b.length<=m;)b.push(0);b[m]|=f<<8*(r+p%4*-1);k+=2}return{value:b,binLen:8*k+d}};break;case "B64":d=function(a,b,c){var f=0,d,k,e,h,q,m,p;if(-1===a.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");k=a.indexOf("=");a=a.replace(/\=/g, -"");if(-1!==k&&ku)throw Error("numRounds must a integer >= 1");if(0===c.lastIndexOf("SHA-",0))if(q=function(a,b){return A(a,b,c)},y=function(a,b,g,h){var d,e;if("SHA-224"===c||"SHA-256"===c)d=(b+65>>>9<<4)+15,e=16;else throw Error("Unexpected error in SHA-2 implementation");for(;a.length<=d;)a.push(0);a[b>>>5]|=128<<24-b%32;b=b+g;a[d]=b&4294967295; +a[d-1]=b/4294967296|0;g=a.length;for(b=0;b>>3;h=d/4-1;for(d>>5;c=n(a,b,h);a=c.binLen;d=c.value;c=a>>>5;for(e=0;e>>5);h=a%l;z=!0};this.getHash=function(a,d){var e,l,n,q;if(!0===m)throw Error("Cannot call getHash after setting HMAC key"); +n=C(d);switch(a){case "HEX":e=function(a){return D(a,f,n)};break;case "B64":e=function(a){return E(a,f,n)};break;case "BYTES":e=function(a){return F(a,f)};break;case "ARRAYBUFFER":try{l=new ArrayBuffer(0)}catch(v){throw Error("ARRAYBUFFER not supported by this environment");}e=function(a){return G(a,f)};break;case "UINT8ARRAY":try{l=new Uint8Array(0)}catch(v){throw Error("UINT8ARRAY not supported by this environment");}e=function(a){return H(a,f)};break;default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY"); +}q=y(b.slice(),h,g,p(k));for(l=1;l>>3;for(g=0;g>>2,a.length<=h&&a.push(0),a[h]|=c[g]<<8*(3+e%4*-1);return{value:a,binLen:8*c.length+d}}function D(c,a,d){var g="";a/=8;var b, +h;for(b=0;b>>2]>>>8*(3+b%4*-1),g+="0123456789abcdef".charAt(h>>>4&15)+"0123456789abcdef".charAt(h&15);return d.outputUpper?g.toUpperCase():g}function E(c,a,d){var g="",b=a/8,h,e,k;for(h=0;h>>2]:0,k=h+2>>2]:0,k=(c[h>>>2]>>>8*(3+h%4*-1)&255)<<16|(e>>>8*(3+(h+1)%4*-1)&255)<<8|k>>>8*(3+(h+2)%4*-1)&255,e=0;4>e;e+=1)8*h+6*e<=a?g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k>>>6*(3-e)&63):g+=d.b64Pad;return g}function F(c,a){var d= +"",g=a/8,b,h;for(b=0;b>>2]>>>8*(3+b%4*-1)&255,d+=String.fromCharCode(h);return d}function G(c,a){var d=a/8,g,b=new ArrayBuffer(d),h;h=new Uint8Array(b);for(g=0;g>>2]>>>8*(3+g%4*-1)&255;return b}function H(c,a){var d=a/8,g,b=new Uint8Array(d);for(g=0;g>>2]>>>8*(3+g%4*-1)&255;return b}function C(c){var a={outputUpper:!1,b64Pad:"=",shakeLen:-1};c=c||{};a.outputUpper=c.outputUpper||!1;!0===c.hasOwnProperty("b64Pad")&&(a.b64Pad=c.b64Pad);if("boolean"!==typeof a.outputUpper)throw Error("Invalid outputUpper formatting option"); +if("string"!==typeof a.b64Pad)throw Error("Invalid b64Pad formatting option");return a}function B(c,a){var d;switch(a){case "UTF8":case "UTF16BE":case "UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE");}switch(c){case "HEX":d=function(a,b,c){var d=a.length,k,n,f,l,q;if(0!==d%2)throw Error("String of HEX type must be in byte increments");b=b||[0];c=c||0;q=c>>>3;for(k=0;k>>1)+q;for(f=l>>>2;b.length<=f;)b.push(0);b[f]|=n<<8*(3+l%4*-1)}return{value:b,binLen:4*d+c}};break;case "TEXT":d=function(c,b,d){var e,k,n=0,f,l,q,m,p,r;b=b||[0];d=d||0;q=d>>>3;if("UTF8"===a)for(r=3,f=0;fe?k.push(e):2048>e?(k.push(192|e>>>6),k.push(128|e&63)):55296>e||57344<=e?k.push(224|e>>>12,128|e>>>6&63,128|e&63):(f+=1,e=65536+((e&1023)<<10|c.charCodeAt(f)&1023),k.push(240|e>>>18,128|e>>>12&63,128|e>>>6&63,128|e&63)),l=0;l>>2;b.length<=m;)b.push(0);b[m]|=k[l]<<8*(r+p%4*-1);n+=1}else if("UTF16BE"===a||"UTF16LE"===a)for(r=2,k="UTF16LE"===a&&!0||"UTF16LE"!==a&&!1,f=0;f>>8);p=n+q;for(m=p>>>2;b.length<=m;)b.push(0);b[m]|=e<<8*(r+p%4*-1);n+=2}return{value:b,binLen:8*n+d}};break;case "B64":d=function(a,b,c){var d=0,k,n,f,l,q,m,p;if(-1===a.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");n=a.indexOf("=");a=a.replace(/\=/g, +"");if(-1!==n&&n + * Build: `lodash modularize exports="npm" -o ./` + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; -module.exports = MapCache; - -},{"./_mapCacheClear":87,"./_mapCacheDelete":88,"./_mapCacheGet":89,"./_mapCacheHas":90,"./_mapCacheSet":91}],38:[function(require,module,exports){ -var getNative = require('./_getNative'), - root = require('./_root'); - -/* Built-in method references that are verified to be native. */ -var Promise = getNative(root, 'Promise'); +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; -module.exports = Promise; +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; -},{"./_getNative":68,"./_root":98}],39:[function(require,module,exports){ -var getNative = require('./_getNative'), - root = require('./_root'); +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; -/* Built-in method references that are verified to be native. */ -var Set = getNative(root, 'Set'); +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; -module.exports = Set; +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]'; -},{"./_getNative":68,"./_root":98}],40:[function(require,module,exports){ -var MapCache = require('./_MapCache'), - setCacheAdd = require('./_setCacheAdd'), - setCacheHas = require('./_setCacheHas'); +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; /** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ -function SetCache(values) { - var index = -1, - length = values == null ? 0 : values.length; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } -} - -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -module.exports = SetCache; - -},{"./_MapCache":37,"./_setCacheAdd":99,"./_setCacheHas":100}],41:[function(require,module,exports){ -var ListCache = require('./_ListCache'), - stackClear = require('./_stackClear'), - stackDelete = require('./_stackDelete'), - stackGet = require('./_stackGet'), - stackHas = require('./_stackHas'), - stackSet = require('./_stackSet'); +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; -/** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; -} +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; -// Add methods to `Stack`. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; -module.exports = Stack; +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; -},{"./_ListCache":35,"./_stackClear":102,"./_stackDelete":103,"./_stackGet":104,"./_stackHas":105,"./_stackSet":106}],42:[function(require,module,exports){ -var root = require('./_root'); +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; -/** Built-in value references. */ -var Symbol = root.Symbol; +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; -module.exports = Symbol; +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); -},{"./_root":98}],43:[function(require,module,exports){ -var root = require('./_root'); +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; -/** Built-in value references. */ -var Uint8Array = root.Uint8Array; +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; -module.exports = Uint8Array; +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; -},{"./_root":98}],44:[function(require,module,exports){ -var getNative = require('./_getNative'), - root = require('./_root'); +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; -/* Built-in method references that are verified to be native. */ -var WeakMap = getNative(root, 'WeakMap'); +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); -module.exports = WeakMap; +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; -},{"./_getNative":68,"./_root":98}],45:[function(require,module,exports){ /** * A specialized version of `_.filter` for arrays without support for * iteratee shorthands. @@ -5488,60 +5385,6 @@ function arrayFilter(array, predicate) { return result; } -module.exports = arrayFilter; - -},{}],46:[function(require,module,exports){ -var baseTimes = require('./_baseTimes'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isBuffer = require('./isBuffer'), - isIndex = require('./_isIndex'), - isTypedArray = require('./isTypedArray'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; -} - -module.exports = arrayLikeKeys; - -},{"./_baseTimes":58,"./_isIndex":78,"./isArguments":109,"./isArray":110,"./isBuffer":112,"./isTypedArray":118}],47:[function(require,module,exports){ /** * Appends the elements of `values` to `array`. * @@ -5561,9 +5404,6 @@ function arrayPush(array, values) { return array; } -module.exports = arrayPush; - -},{}],48:[function(require,module,exports){ /** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. @@ -5586,1647 +5426,1284 @@ function arraySome(array, predicate) { return false; } -module.exports = arraySome; - -},{}],49:[function(require,module,exports){ -var eq = require('./eq'); - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. * * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); } - return -1; + return result; } -module.exports = assocIndexOf; - -},{"./eq":108}],50:[function(require,module,exports){ -var arrayPush = require('./_arrayPush'), - isArray = require('./isArray'); - /** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. + * The base implementation of `_.unary` without support for storing metadata. * * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. */ -function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +function baseUnary(func) { + return function(value) { + return func(value); + }; } -module.exports = baseGetAllKeys; - -},{"./_arrayPush":47,"./isArray":110}],51:[function(require,module,exports){ -var Symbol = require('./_Symbol'), - getRawTag = require('./_getRawTag'), - objectToString = require('./_objectToString'); - -/** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; - -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; - /** - * The base implementation of `getTag` without fallbacks for buggy environments. + * Checks if a `cache` value for `key` exists. * * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); +function cacheHas(cache, key) { + return cache.has(key); } -module.exports = baseGetTag; - -},{"./_Symbol":42,"./_getRawTag":69,"./_objectToString":96}],52:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]'; - /** - * The base implementation of `_.isArguments`. + * Gets the value at `key` of `object`. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. */ -function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; +function getValue(object, key) { + return object == null ? undefined : object[key]; } -module.exports = baseIsArguments; - -},{"./_baseGetTag":51,"./isObjectLike":117}],53:[function(require,module,exports){ -var baseIsEqualDeep = require('./_baseIsEqualDeep'), - isObjectLike = require('./isObjectLike'); - /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. + * Converts `map` to its key-value pairs. * * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {boolean} bitmask The bitmask flags. - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Function} [customizer] The function to customize comparisons. - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. */ -function baseIsEqual(value, other, bitmask, customizer, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); -} - -module.exports = baseIsEqual; - -},{"./_baseIsEqualDeep":54,"./isObjectLike":117}],54:[function(require,module,exports){ -var Stack = require('./_Stack'), - equalArrays = require('./_equalArrays'), - equalByTag = require('./_equalByTag'), - equalObjects = require('./_equalObjects'), - getTag = require('./_getTag'), - isArray = require('./isArray'), - isBuffer = require('./isBuffer'), - isTypedArray = require('./isTypedArray'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - objectTag = '[object Object]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; +function mapToArray(map) { + var index = -1, + result = Array(map.size); -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. + * Creates a unary function that invokes `func` with its argument transformed. * * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. */ -function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = objIsArr ? arrayTag : getTag(object), - othTag = othIsArr ? arrayTag : getTag(other); - - objTag = objTag == argsTag ? objectTag : objTag; - othTag = othTag == argsTag ? objectTag : othTag; - - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; - - if (isSameTag && isBuffer(object)) { - if (!isBuffer(other)) { - return false; - } - objIsArr = true; - objIsObj = false; - } - if (isSameTag && !objIsObj) { - stack || (stack = new Stack); - return (objIsArr || isTypedArray(object)) - ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) - : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); - } - if (!(bitmask & COMPARE_PARTIAL_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; - - stack || (stack = new Stack); - return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; } -module.exports = baseIsEqualDeep; - -},{"./_Stack":41,"./_equalArrays":62,"./_equalByTag":63,"./_equalObjects":64,"./_getTag":71,"./isArray":110,"./isBuffer":112,"./isTypedArray":118}],55:[function(require,module,exports){ -var isFunction = require('./isFunction'), - isMasked = require('./_isMasked'), - isObject = require('./isObject'), - toSource = require('./_toSource'); - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +function setToArray(set) { + var index = -1, + result = Array(set.size); -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} /** Used for built-in method references. */ -var funcProto = Function.prototype, +var arrayProto = Array.prototype, + funcProto = Function.prototype, objectProto = Object.prototype; +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + /** - * The base implementation of `_.isNative` without bad shim checks. + * Creates a hash object. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -module.exports = baseIsNative; - -},{"./_isMasked":80,"./_toSource":107,"./isFunction":114,"./isObject":116}],56:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isLength = require('./isLength'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = -typedArrayTags[errorTag] = typedArrayTags[funcTag] = -typedArrayTags[mapTag] = typedArrayTags[numberTag] = -typedArrayTags[objectTag] = typedArrayTags[regexpTag] = -typedArrayTags[setTag] = typedArrayTags[stringTag] = -typedArrayTags[weakMapTag] = false; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} /** - * The base implementation of `_.isTypedArray` without Node.js optimizations. + * Removes all key-value entries from the hash. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @name clear + * @memberOf Hash */ -function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; } -module.exports = baseIsTypedArray; - -},{"./_baseGetTag":51,"./isLength":115,"./isObjectLike":117}],57:[function(require,module,exports){ -var isPrototype = require('./_isPrototype'), - nativeKeys = require('./_nativeKeys'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - /** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * Removes `key` and its value from the hash. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; return result; } -module.exports = baseKeys; - -},{"./_isPrototype":81,"./_nativeKeys":94}],58:[function(require,module,exports){ /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. + * Gets the hash value for `key`. * * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; } - return result; + return hasOwnProperty.call(data, key) ? data[key] : undefined; } -module.exports = baseTimes; - -},{}],59:[function(require,module,exports){ /** - * The base implementation of `_.unary` without support for storing metadata. + * Checks if a hash value for `key` exists. * * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ -function baseUnary(func) { - return function(value) { - return func(value); - }; +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } -module.exports = baseUnary; - -},{}],60:[function(require,module,exports){ /** - * Checks if a `cache` value for `key` exists. + * Sets the hash `key` to `value`. * * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. */ -function cacheHas(cache, key) { - return cache.has(key); +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; } -module.exports = cacheHas; - -},{}],61:[function(require,module,exports){ -var root = require('./_root'); - -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; -module.exports = coreJsData; +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; -},{"./_root":98}],62:[function(require,module,exports){ -var SetCache = require('./_SetCache'), - arraySome = require('./_arraySome'), - cacheHas = require('./_cacheHas'); + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. + * Removes `key` and its value from the list cache. * * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ -function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - arrLength = array.length, - othLength = other.length; +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + if (index < 0) { return false; } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked && stack.get(other)) { - return stacked == other; + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); } - var index = -1, - result = true, - seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + --this.size; + return true; +} - stack.set(array, other); - stack.set(other, array); +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!cacheHas(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, bitmask, customizer, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; -} - -module.exports = equalArrays; - -},{"./_SetCache":40,"./_arraySome":48,"./_cacheHas":60}],63:[function(require,module,exports){ -var Symbol = require('./_Symbol'), - Uint8Array = require('./_Uint8Array'), - eq = require('./eq'), - equalArrays = require('./_equalArrays'), - mapToArray = require('./_mapToArray'), - setToArray = require('./_setToArray'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - -/** `Object#toString` result references. */ -var boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - mapTag = '[object Map]', - numberTag = '[object Number]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]'; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; - -/** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { - switch (tag) { - case dataViewTag: - if ((object.byteLength != other.byteLength) || - (object.byteOffset != other.byteOffset)) { - return false; - } - object = object.buffer; - other = other.buffer; - - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; - - case boolTag: - case dateTag: - case numberTag: - // Coerce booleans to `1` or `0` and dates to milliseconds. - // Invalid dates are coerced to `NaN`. - return eq(+object, +other); - - case errorTag: - return object.name == other.name && object.message == other.message; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring - // for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & COMPARE_PARTIAL_FLAG; - convert || (convert = setToArray); - - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - bitmask |= COMPARE_UNORDERED_FLAG; - - // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); - stack['delete'](object); - return result; - - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; -} - -module.exports = equalByTag; - -},{"./_Symbol":42,"./_Uint8Array":43,"./_equalArrays":62,"./_mapToArray":92,"./_setToArray":101,"./eq":108}],64:[function(require,module,exports){ -var getAllKeys = require('./_getAllKeys'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - objProps = getAllKeys(object), - objLength = objProps.length, - othProps = getAllKeys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked && stack.get(other)) { - return stacked == other; - } - var result = true; - stack.set(object, other); - stack.set(other, object); - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - stack['delete'](other); - return result; -} - -module.exports = equalObjects; - -},{"./_getAllKeys":66}],65:[function(require,module,exports){ -(function (global){ -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -module.exports = freeGlobal; - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],66:[function(require,module,exports){ -var baseGetAllKeys = require('./_baseGetAllKeys'), - getSymbols = require('./_getSymbols'), - keys = require('./keys'); - -/** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); -} - -module.exports = getAllKeys; - -},{"./_baseGetAllKeys":50,"./_getSymbols":70,"./keys":119}],67:[function(require,module,exports){ -var isKeyable = require('./_isKeyable'); - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -module.exports = getMapData; - -},{"./_isKeyable":79}],68:[function(require,module,exports){ -var baseIsNative = require('./_baseIsNative'), - getValue = require('./_getValue'); - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} - -module.exports = getNative; - -},{"./_baseIsNative":55,"./_getValue":72}],69:[function(require,module,exports){ -var Symbol = require('./_Symbol'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; - -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; -} - -module.exports = getRawTag; - -},{"./_Symbol":42}],70:[function(require,module,exports){ -var arrayFilter = require('./_arrayFilter'), - stubArray = require('./stubArray'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols; + return index < 0 ? undefined : data[index][1]; +} /** - * Creates an array of the own enumerable symbols of `object`. + * Checks if a list cache value for `key` exists. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ -var getSymbols = !nativeGetSymbols ? stubArray : function(object) { - if (object == null) { - return []; - } - object = Object(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol); - }); -}; - -module.exports = getSymbols; - -},{"./_arrayFilter":45,"./stubArray":120}],71:[function(require,module,exports){ -var DataView = require('./_DataView'), - Map = require('./_Map'), - Promise = require('./_Promise'), - Set = require('./_Set'), - WeakMap = require('./_WeakMap'), - baseGetTag = require('./_baseGetTag'), - toSource = require('./_toSource'); - -/** `Object#toString` result references. */ -var mapTag = '[object Map]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - setTag = '[object Set]', - weakMapTag = '[object WeakMap]'; - -var dataViewTag = '[object DataView]'; - -/** Used to detect maps, sets, and weakmaps. */ -var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} /** - * Gets the `toStringTag` of `value`. + * Sets the list cache `key` to `value`. * * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. */ -var getTag = baseGetTag; - -// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. -if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; } -module.exports = getTag; +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; -},{"./_DataView":33,"./_Map":36,"./_Promise":38,"./_Set":39,"./_WeakMap":44,"./_baseGetTag":51,"./_toSource":107}],72:[function(require,module,exports){ /** - * Gets the value at `key` of `object`. + * Creates a map cache object to store key-value pairs. * * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} - -module.exports = getValue; +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; -},{}],73:[function(require,module,exports){ -var nativeCreate = require('./_nativeCreate'); + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} /** - * Removes all key-value entries from the hash. + * Removes all key-value entries from the map. * * @private * @name clear - * @memberOf Hash + * @memberOf MapCache */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; +function mapCacheClear() { this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; } -module.exports = hashClear; - -},{"./_nativeCreate":93}],74:[function(require,module,exports){ /** - * Removes `key` and its value from the hash. + * Removes `key` and its value from the map. * * @private * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. + * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ -function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } -module.exports = hashDelete; - -},{}],75:[function(require,module,exports){ -var nativeCreate = require('./_nativeCreate'); - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - /** - * Gets the hash value for `key`. + * Gets the map value for `key`. * * @private * @name get - * @memberOf Hash + * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; +function mapCacheGet(key) { + return getMapData(this, key).get(key); } -module.exports = hashGet; - -},{"./_nativeCreate":93}],76:[function(require,module,exports){ -var nativeCreate = require('./_nativeCreate'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - /** - * Checks if a hash value for `key` exists. + * Checks if a map value for `key` exists. * * @private * @name has - * @memberOf Hash + * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +function mapCacheHas(key) { + return getMapData(this, key).has(key); } -module.exports = hashHas; - -},{"./_nativeCreate":93}],77:[function(require,module,exports){ -var nativeCreate = require('./_nativeCreate'); - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - /** - * Sets the hash `key` to `value`. + * Sets the map `key` to `value`. * * @private * @name set - * @memberOf Hash + * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. + * @returns {Object} Returns the map cache instance. */ -function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; return this; } -module.exports = hashSet; - -},{"./_nativeCreate":93}],78:[function(require,module,exports){ -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; /** - * Checks if `value` is a valid array-like index. * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); -} - -module.exports = isIndex; - -},{}],79:[function(require,module,exports){ -/** - * Checks if `value` is suitable for use as unique object key. + * Creates an array cache object to store unique values. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + * @constructor + * @param {Array} [values] The values to cache. */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } } -module.exports = isKeyable; - -},{}],80:[function(require,module,exports){ -var coreJsData = require('./_coreJsData'); - -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - /** - * Checks if `func` has its source masked. + * Adds `value` to the array cache. * * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; } -module.exports = isMasked; +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} -},{"./_coreJsData":61}],81:[function(require,module,exports){ -/** Used for built-in method references. */ -var objectProto = Object.prototype; +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; /** - * Checks if `value` is likely a prototype object. + * Creates a stack cache object to store key-value pairs. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; } -module.exports = isPrototype; - -},{}],82:[function(require,module,exports){ /** - * Removes all key-value entries from the list cache. + * Removes all key-value entries from the stack. * * @private * @name clear - * @memberOf ListCache + * @memberOf Stack */ -function listCacheClear() { - this.__data__ = []; +function stackClear() { + this.__data__ = new ListCache; this.size = 0; } -module.exports = listCacheClear; - -},{}],83:[function(require,module,exports){ -var assocIndexOf = require('./_assocIndexOf'); - -/** Used for built-in method references. */ -var arrayProto = Array.prototype; - -/** Built-in value references. */ -var splice = arrayProto.splice; - /** - * Removes `key` and its value from the list cache. + * Removes `key` and its value from the stack. * * @private * @name delete - * @memberOf ListCache + * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ -function listCacheDelete(key) { +function stackDelete(key) { var data = this.__data__, - index = assocIndexOf(data, key); + result = data['delete'](key); - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - --this.size; - return true; + this.size = data.size; + return result; } -module.exports = listCacheDelete; - -},{"./_assocIndexOf":49}],84:[function(require,module,exports){ -var assocIndexOf = require('./_assocIndexOf'); - /** - * Gets the list cache value for `key`. + * Gets the stack value for `key`. * * @private * @name get - * @memberOf ListCache + * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; +function stackGet(key) { + return this.__data__.get(key); } -module.exports = listCacheGet; - -},{"./_assocIndexOf":49}],85:[function(require,module,exports){ -var assocIndexOf = require('./_assocIndexOf'); - /** - * Checks if a list cache value for `key` exists. + * Checks if a stack value for `key` exists. * * @private * @name has - * @memberOf ListCache + * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; +function stackHas(key) { + return this.__data__.has(key); } -module.exports = listCacheHas; - -},{"./_assocIndexOf":49}],86:[function(require,module,exports){ -var assocIndexOf = require('./_assocIndexOf'); - /** - * Sets the list cache `key` to `value`. + * Sets the stack `key` to `value`. * * @private * @name set - * @memberOf ListCache + * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. + * @returns {Object} Returns the stack cache instance. */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; } - return this; + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } -module.exports = listCacheSet; - -},{"./_assocIndexOf":49}],87:[function(require,module,exports){ -var Hash = require('./_Hash'), - ListCache = require('./_ListCache'), - Map = require('./_Map'); - /** - * Removes all key-value entries from the map. + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. * * @private - * @name clear - * @memberOf MapCache + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ -function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); -module.exports = mapCacheClear; + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; -},{"./_Hash":34,"./_ListCache":35,"./_Map":36}],88:[function(require,module,exports){ -var getMapData = require('./_getMapData'); + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; -} + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); -module.exports = mapCacheDelete; + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; -},{"./_getMapData":67}],89:[function(require,module,exports){ -var getMapData = require('./_getMapData'); + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} /** - * Gets the map value for `key`. + * The base implementation of `_.isNative` without bad shim checks. * * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); } -module.exports = mapCacheGet; - -},{"./_getMapData":67}],90:[function(require,module,exports){ -var getMapData = require('./_getMapData'); - /** - * Checks if a map value for `key` exists. + * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } -module.exports = mapCacheHas; - -},{"./_getMapData":67}],91:[function(require,module,exports){ -var getMapData = require('./_getMapData'); - /** - * Sets the map `key` to `value`. + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. */ -function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; - - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; } -module.exports = mapCacheSet; - -},{"./_getMapData":67}],92:[function(require,module,exports){ /** - * Converts `map` to its key-value pairs. + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. * * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ -function mapToArray(map) { +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } var index = -1, - result = Array(map.size); + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; -} + stack.set(array, other); + stack.set(other, array); -module.exports = mapToArray; + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; -},{}],93:[function(require,module,exports){ -var getNative = require('./_getNative'); + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} -/* Built-in method references that are verified to be native. */ -var nativeCreate = getNative(Object, 'create'); +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; -module.exports = nativeCreate; + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; -},{"./_getNative":68}],94:[function(require,module,exports){ -var overArg = require('./_overArg'); + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = overArg(Object.keys, Object); + case errorTag: + return object.name == other.name && object.message == other.message; -module.exports = nativeKeys; + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); -},{"./_overArg":97}],95:[function(require,module,exports){ -var freeGlobal = require('./_freeGlobal'); + case mapTag: + var convert = mapToArray; -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports && freeGlobal.process; + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; - if (types) { - return types; + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} -}()); + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; -module.exports = nodeUtil; + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; -},{"./_freeGlobal":65}],96:[function(require,module,exports){ -/** Used for built-in method references. */ -var objectProto = Object.prototype; + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. */ -var nativeObjectToString = objectProto.toString; +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} /** - * Converts `value` to a string using `Object.prototype.toString`. + * Gets the data for `map`. * * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. */ -function objectToString(value) { - return nativeObjectToString.call(value); +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; } -module.exports = objectToString; - -},{}],97:[function(require,module,exports){ /** - * Creates a unary function that invokes `func` with its argument transformed. + * Gets the native function at `key` of `object`. * * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; } -module.exports = overArg; - -},{}],98:[function(require,module,exports){ -var freeGlobal = require('./_freeGlobal'); - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -module.exports = root; - -},{"./_freeGlobal":65}],99:[function(require,module,exports){ -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - /** - * Adds `value` to the array cache. + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. */ -function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; -} +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} -module.exports = setCacheAdd; + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} -},{}],100:[function(require,module,exports){ /** - * Checks if `value` is in the array cache. + * Creates an array of the own enumerable symbols of `object`. * * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. */ -function setCacheHas(value) { - return this.__data__.has(value); -} - -module.exports = setCacheHas; +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; -},{}],101:[function(require,module,exports){ /** - * Converts `set` to an array of its values. + * Gets the `toStringTag` of `value`. * * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. */ -function setToArray(set) { - var index = -1, - result = Array(set.size); +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; - set.forEach(function(value) { - result[++index] = value; - }); - return result; + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; } -module.exports = setToArray; - -},{}],102:[function(require,module,exports){ -var ListCache = require('./_ListCache'); - /** - * Removes all key-value entries from the stack. + * Checks if `value` is a valid array-like index. * * @private - * @name clear - * @memberOf Stack + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ -function stackClear() { - this.__data__ = new ListCache; - this.size = 0; +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); } -module.exports = stackClear; - -},{"./_ListCache":35}],103:[function(require,module,exports){ /** - * Removes `key` and its value from the stack. + * Checks if `value` is suitable for use as unique object key. * * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ -function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); - - this.size = data.size; - return result; +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); } -module.exports = stackDelete; - -},{}],104:[function(require,module,exports){ /** - * Gets the stack value for `key`. + * Checks if `func` has its source masked. * * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ -function stackGet(key) { - return this.__data__.get(key); +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); } -module.exports = stackGet; - -},{}],105:[function(require,module,exports){ /** - * Checks if a stack value for `key` exists. + * Checks if `value` is likely a prototype object. * * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ -function stackHas(key) { - return this.__data__.has(key); -} - -module.exports = stackHas; - -},{}],106:[function(require,module,exports){ -var ListCache = require('./_ListCache'), - Map = require('./_Map'), - MapCache = require('./_MapCache'); +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; + return value === proto; +} /** - * Sets the stack `key` to `value`. + * Converts `value` to a string using `Object.prototype.toString`. * * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. */ -function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); - } - data.set(key, value); - this.size = data.size; - return this; +function objectToString(value) { + return nativeObjectToString.call(value); } -module.exports = stackSet; - -},{"./_ListCache":35,"./_Map":36,"./_MapCache":37}],107:[function(require,module,exports){ -/** Used for built-in method references. */ -var funcProto = Function.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - /** * Converts `func` to its source code. * @@ -7246,9 +6723,6 @@ function toSource(func) { return ''; } -module.exports = toSource; - -},{}],108:[function(require,module,exports){ /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) @@ -7285,21 +6759,6 @@ function eq(value, other) { return value === other || (value !== value && other !== other); } -module.exports = eq; - -},{}],109:[function(require,module,exports){ -var baseIsArguments = require('./_baseIsArguments'), - isObjectLike = require('./isObjectLike'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - /** * Checks if `value` is likely an `arguments` object. * @@ -7323,9 +6782,6 @@ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsAr !propertyIsEnumerable.call(value, 'callee'); }; -module.exports = isArguments; - -},{"./_baseIsArguments":52,"./isObjectLike":117}],110:[function(require,module,exports){ /** * Checks if `value` is classified as an `Array` object. * @@ -7351,12 +6807,6 @@ module.exports = isArguments; */ var isArray = Array.isArray; -module.exports = isArray; - -},{}],111:[function(require,module,exports){ -var isFunction = require('./isFunction'), - isLength = require('./isLength'); - /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or @@ -7386,27 +6836,6 @@ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } -module.exports = isArrayLike; - -},{"./isFunction":114,"./isLength":115}],112:[function(require,module,exports){ -var root = require('./_root'), - stubFalse = require('./stubFalse'); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; - /** * Checks if `value` is a buffer. * @@ -7426,11 +6855,6 @@ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; */ var isBuffer = nativeIsBuffer || stubFalse; -module.exports = isBuffer; - -},{"./_root":98,"./stubFalse":121}],113:[function(require,module,exports){ -var baseIsEqual = require('./_baseIsEqual'); - /** * Performs a deep comparison between two values to determine if they are * equivalent. @@ -7463,18 +6887,6 @@ function isEqual(value, other) { return baseIsEqual(value, other); } -module.exports = isEqual; - -},{"./_baseIsEqual":53}],114:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isObject = require('./isObject'); - -/** `Object#toString` result references. */ -var asyncTag = '[object AsyncFunction]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - proxyTag = '[object Proxy]'; - /** * Checks if `value` is classified as a `Function` object. * @@ -7502,12 +6914,6 @@ function isFunction(value) { return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } -module.exports = isFunction; - -},{"./_baseGetTag":51,"./isObject":116}],115:[function(require,module,exports){ -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - /** * Checks if `value` is a valid array-like length. * @@ -7539,9 +6945,6 @@ function isLength(value) { value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } -module.exports = isLength; - -},{}],116:[function(require,module,exports){ /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) @@ -7572,9 +6975,6 @@ function isObject(value) { return value != null && (type == 'object' || type == 'function'); } -module.exports = isObject; - -},{}],117:[function(require,module,exports){ /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". @@ -7603,16 +7003,6 @@ function isObjectLike(value) { return value != null && typeof value == 'object'; } -module.exports = isObjectLike; - -},{}],118:[function(require,module,exports){ -var baseIsTypedArray = require('./_baseIsTypedArray'), - baseUnary = require('./_baseUnary'), - nodeUtil = require('./_nodeUtil'); - -/* Node.js helper references. */ -var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - /** * Checks if `value` is classified as a typed array. * @@ -7632,13 +7022,6 @@ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; -module.exports = isTypedArray; - -},{"./_baseIsTypedArray":56,"./_baseUnary":59,"./_nodeUtil":95}],119:[function(require,module,exports){ -var arrayLikeKeys = require('./_arrayLikeKeys'), - baseKeys = require('./_baseKeys'), - isArrayLike = require('./isArrayLike'); - /** * Creates an array of the own enumerable property names of `object`. * @@ -7671,9 +7054,6 @@ function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } -module.exports = keys; - -},{"./_arrayLikeKeys":46,"./_baseKeys":57,"./isArrayLike":111}],120:[function(require,module,exports){ /** * This method returns a new empty array. * @@ -7696,9 +7076,6 @@ function stubArray() { return []; } -module.exports = stubArray; - -},{}],121:[function(require,module,exports){ /** * This method returns `false`. * @@ -7716,9 +7093,10 @@ function stubFalse() { return false; } -module.exports = stubFalse; +module.exports = isEqual; -},{}],122:[function(require,module,exports){ +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],34:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -7904,7 +7282,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],123:[function(require,module,exports){ +},{}],35:[function(require,module,exports){ /* eslint-disable node/no-deprecated-api */ var buffer = require('buffer') var Buffer = buffer.Buffer @@ -7968,7 +7346,7 @@ SafeBuffer.allocUnsafeSlow = function (size) { return buffer.SlowBuffer(size) } -},{"buffer":4}],124:[function(require,module,exports){ +},{"buffer":4}],36:[function(require,module,exports){ var cbor = require('cbor-js'); var CRC = require('crc'); var base58 = require('./crypto/base58'); @@ -8005,7 +7383,7 @@ module.exports = { } }; -},{"./crypto/base58":128,"cbor-js":5,"crc":30}],125:[function(require,module,exports){ +},{"./crypto/base58":40,"cbor-js":5,"crc":30}],37:[function(require,module,exports){ var cryptoUtils = require('./crypto/utils'); var bech32 = require('./crypto/bech32'); var BTCValidator = require('./bitcoin_validator'); @@ -8053,7 +7431,7 @@ module.exports = { return validateAddress(address, currency, networkType) || BTCValidator.isValidAddress(address, currency, networkType); } } -},{"./bitcoin_validator":126,"./crypto/bech32":129,"./crypto/utils":136}],126:[function(require,module,exports){ +},{"./bitcoin_validator":38,"./crypto/bech32":41,"./crypto/utils":48}],38:[function(require,module,exports){ (function (Buffer){ var base58 = require('./crypto/base58'); var segwit = require('./crypto/segwit_addr'); @@ -8143,7 +7521,7 @@ module.exports = { }; }).call(this,require("buffer").Buffer) -},{"./crypto/base58":128,"./crypto/segwit_addr":134,"./crypto/utils":136,"buffer":4}],127:[function(require,module,exports){ +},{"./crypto/base58":40,"./crypto/segwit_addr":46,"./crypto/utils":48,"buffer":4}],39:[function(require,module,exports){ var alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; /** @@ -8210,7 +7588,7 @@ module.exports = { b32decode: b32decode, b32encode: b32encode }; -},{}],128:[function(require,module,exports){ +},{}],40:[function(require,module,exports){ // Base58 encoding/decoding // Originally written by Mike Hearn for BitcoinJ // Copyright (c) 2011 Google Inc @@ -8258,7 +7636,7 @@ module.exports = { } }; -},{}],129:[function(require,module,exports){ +},{}],41:[function(require,module,exports){ // Copyright (c) 2017 Pieter Wuille // // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -8377,7 +7755,7 @@ function decode (bechString) { return {hrp: hrp, data: data.slice(0, data.length - 6)}; } -},{}],130:[function(require,module,exports){ +},{}],42:[function(require,module,exports){ /* JavaScript BigInteger library version 0.9.1 http://silentmatt.com/biginteger/ @@ -9828,7 +9206,7 @@ function decode (bechString) { exports.JSBigInt = BigInteger; // exports.BigInteger changed to exports.JSBigInt })(typeof exports !== 'undefined' ? exports : this); -},{}],131:[function(require,module,exports){ +},{}],43:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -10019,7 +9397,7 @@ Blake256.prototype.digest = function (encoding) { module.exports = Blake256; }).call(this,require("buffer").Buffer) -},{"buffer":4}],132:[function(require,module,exports){ +},{"buffer":4}],44:[function(require,module,exports){ 'use strict'; /** @@ -10297,7 +9675,7 @@ function toHex (n) { module.exports = Blake2b; -},{}],133:[function(require,module,exports){ +},{}],45:[function(require,module,exports){ var JSBigInt = require('./biginteger')['JSBigInt']; /** @@ -10524,7 +9902,7 @@ var cnBase58 = (function () { return b58; })(); module.exports = cnBase58; -},{"./biginteger":130}],134:[function(require,module,exports){ +},{"./biginteger":42}],46:[function(require,module,exports){ // Copyright (c) 2017 Pieter Wuille // // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -10620,7 +9998,7 @@ module.exports = { isValidAddress: isValidAddress, }; -},{"./bech32":129}],135:[function(require,module,exports){ +},{"./bech32":41}],47:[function(require,module,exports){ (function (process,global){ /** * [js-sha3]{@link https://github.com/emn178/js-sha3} @@ -11264,7 +10642,7 @@ var f = function (s) { module.exports = methods; }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":122}],136:[function(require,module,exports){ +},{"_process":34}],48:[function(require,module,exports){ (function (Buffer){ var jsSHA = require('jssha/src/sha256'); var Blake256 = require('./blake256'); @@ -11393,7 +10771,7 @@ module.exports = { } }).call(this,require("buffer").Buffer) -},{"./base32":127,"./base58":128,"./blake256":131,"./blake2b":132,"./sha3":135,"browserify-bignum":3,"buffer":4,"jssha/src/sha256":32}],137:[function(require,module,exports){ +},{"./base32":39,"./base58":40,"./blake256":43,"./blake2b":44,"./sha3":47,"browserify-bignum":3,"buffer":4,"jssha/src/sha256":32}],49:[function(require,module,exports){ var XRPValidator = require('./ripple_validator'); var ETHValidator = require('./ethereum_validator'); var BTCValidator = require('./bitcoin_validator'); @@ -11410,399 +10788,398 @@ var EOSValidator = require('./eos_validator'); var XTZValidator = require('./tezos_validator'); // defines P2PKH and P2SH address types for standard (prod) and testnet networks -var CURRENCIES = [ - { - name: 'Bitcoin', - symbol: 'btc', - addressTypes: { prod: ['00', '05'], testnet: ['6f', 'c4', '3c', '26'] }, - validator: BTCValidator - }, { - name: 'BitcoinCash', - symbol: 'bch', - regexp: '^[qQpP]{1}[0-9a-zA-Z]{41}$', - addressTypes: { prod: ['00', '05'], testnet: ['6f', 'c4'] }, - validator: BCHValidator - }, { - name: 'Bitcoin SV', - symbol: 'bsv', - regexp: '^[qQ]{1}[0-9a-zA-Z]{41}$', - addressTypes: { prod: ['00', '05'], testnet: ['6f', 'c4'] }, - validator: BCHValidator - }, { - name: 'LiteCoin', - symbol: 'ltc', - addressTypes: { prod: ['30', '05', '32'], testnet: ['6f', 'c4', '3a'] }, - validator: BTCValidator - }, { - name: 'PeerCoin', - symbol: 'ppc', - addressTypes: { prod: ['37', '75'], testnet: ['6f', 'c4'] }, - validator: BTCValidator - }, { - name: 'DogeCoin', - symbol: 'doge', - addressTypes: { prod: ['1e', '16'], testnet: ['71', 'c4'] }, - validator: BTCValidator - }, { - name: 'BeaverCoin', - symbol: 'bvc', - addressTypes: { prod: ['19', '05'], testnet: ['6f', 'c4'] }, - validator: BTCValidator, - }, { - name: 'FreiCoin', - symbol: 'frc', - addressTypes: { prod: ['00', '05'], testnet: ['6f', 'c4'] }, - validator: BTCValidator - }, { - name: 'ProtoShares', - symbol: 'pts', - addressTypes: { prod: ['38', '05'], testnet: ['6f', 'c4'] }, - validator: BTCValidator - }, { - name: 'MegaCoin', - symbol: 'mec', - addressTypes: { prod: ['32', '05'], testnet: ['6f', 'c4'] }, - validator: BTCValidator - }, { - name: 'PrimeCoin', - symbol: 'xpm', - addressTypes: { prod: ['17', '53'], testnet: ['6f', 'c4'] }, - validator: BTCValidator - }, { - name: 'AuroraCoin', - symbol: 'aur', - addressTypes: { prod: ['17', '05'], testnet: ['6f', 'c4'] }, - validator: BTCValidator - }, { - name: 'NameCoin', - symbol: 'nmc', - addressTypes: { prod: ['34'], testnet: [] }, - validator: BTCValidator - }, { - name: 'BioCoin', - symbol: 'bio', - addressTypes: { prod: ['19', '14'], testnet: ['6f', 'c4'] }, - validator: BTCValidator - }, { - name: 'GarliCoin', - symbol: 'grlc', - addressTypes: { prod: ['26', '05'], testnet: ['6f', 'c4'] }, - validator: BTCValidator - }, { - name: 'VertCoin', - symbol: 'vtc', - addressTypes: { prod: ['0x', '47', '71', '05'], testnet: ['6f', 'c4'] }, - validator: BTCValidator - - }, { - name: 'BitcoinGold', - symbol: 'btg', - addressTypes: { prod: ['26', '17'], testnet: ['6f', 'c4'] }, - validator: BTCValidator - }, { - name: 'Komodo', - symbol: 'kmd', - addressTypes: { prod: ['3c', '55'], testnet: ['0', '5'] }, - validator: BTCValidator - }, { - name: 'BitcoinZ', - symbol: 'btcz', - expectedLength: 26, - addressTypes: { prod: ['1cb8', '1cbd'], testnet: ['1d25', '1cba'] }, - validator: BTCValidator - }, { - name: 'BitcoinPrivate', - symbol: 'btcp', - expectedLength: 26, - addressTypes: { prod: ['1325', '13af'], testnet: ['1957', '19e0'] }, - validator: BTCValidator - }, { - name: 'Hush', - symbol: 'hush', - expectedLength: 26, - addressTypes: { prod: ['1cb8', '1cbd'], testnet: ['1d25', '1cba'] }, - validator: BTCValidator - }, { - name: 'SnowGem', - symbol: 'sng', - expectedLength: 26, - addressTypes: { prod: ['1c28', '1c2d'], testnet: ['1d25', '1cba'] }, - validator: BTCValidator - }, { - name: 'ZCash', - symbol: 'zec', - expectedLength: 26, - addressTypes: { prod: ['1cb8', '1cbd'], testnet: ['1d25', '1cba'] }, - validator: BTCValidator - }, { - name: 'ZClassic', - symbol: 'zcl', - expectedLength: 26, - addressTypes: { prod: ['1cb8', '1cbd'], testnet: ['1d25', '1cba'] }, - validator: BTCValidator - }, { - name: 'ZenCash', - symbol: 'zen', - expectedLength: 26, - addressTypes: { prod: ['2089', '2096'], testnet: ['2092', '2098'] }, - validator: BTCValidator - }, { - name: 'VoteCoin', - symbol: 'vot', - expectedLength: 26, - addressTypes: { prod: ['1cb8', '1cbd'], testnet: ['1d25', '1cba'] }, - validator: BTCValidator - }, { - name: 'Decred', - symbol: 'dcr', - addressTypes: { prod: ['073f', '071a'], testnet: ['0f21', '0efc'] }, - hashFunction: 'blake256', - expectedLength: 26, - validator: BTCValidator - }, { - name: 'GameCredits', - symbol: 'game', - addressTypes: { prod: ['26', '05'], testnet: [] }, - validator: BTCValidator - }, { - name: 'PIVX', - symbol: 'pivx', - addressTypes: { prod: ['1e', '0d'], testnet: [] }, - validator: BTCValidator - }, { - name: 'SolarCoin', - symbol: 'slr', - addressTypes: { prod: ['12', '05'], testnet: [] }, - validator: BTCValidator - }, { - name: 'MonaCoin', - symbol: 'mona', - addressTypes: { prod: ['32', '37'], testnet: [] }, - validator: BTCValidator - }, { - name: 'DigiByte', - symbol: 'dgb', - addressTypes: { prod: ['1e'], testnet: [] }, - validator: BTCValidator - }, { - name: 'Tether', - symbol: 'usdt', - addressTypes: { prod: ['00', '05'], testnet: ['6f', 'c4'] }, - validator: BTCValidator - }, { - name: 'Ripple', - symbol: 'xrp', - validator: XRPValidator, - }, { - name: 'Dash', - symbol: 'dash', - addressTypes: { prod: ['4c', '10'], testnet: ['8c', '13'] }, - validator: BTCValidator - }, { - name: 'Neo', - symbol: 'neo', - addressTypes: { prod: ['17'], testnet: [] }, - validator: BTCValidator - }, { - name: 'NeoGas', - symbol: 'gas', - addressTypes: { prod: ['17'], testnet: [] }, - validator: BTCValidator - }, { - name: 'Qtum', - symbol: 'qtum', - addressTypes: { prod: ['3a', '32'], testnet: ['78', '6e'] }, - validator: BTCValidator - }, { - name: 'Waves', - symbol: 'waves', - addressTypes: { prod: ['0157'], testnet: ['0154'] }, - expectedLength: 26, - hashFunction: 'blake256keccak256', - regex: /^[a-zA-Z0-9]{35}$/, - validator: BTCValidator - }, { - name: 'Ethereum', - symbol: 'eth', - validator: ETHValidator, - }, { - name: 'EtherZero', - symbol: 'etz', - validator: ETHValidator, - }, { - name: 'EthereumClassic', - symbol: 'etc', - validator: ETHValidator, - }, { - name: 'Callisto', - symbol: 'clo', - validator: ETHValidator, - }, { - name: 'Bankex', - symbol: 'bkx', - validator: ETHValidator - }, { - name: 'Cardano', - symbol: 'ada', - validator: ADAValidator - }, { - name: 'Monero', - symbol: 'xmr', - addressTypes: { prod: ['18'], testnet: ['53'] }, - iAddressTypes: { prod: ['19'], testnet: ['54'] }, - validator: XMRValidator - }, { - name: 'Aragon', - symbol: 'ant', - validator: ETHValidator - }, { - name: 'Basic Attention Token', - symbol: 'bat', - validator: ETHValidator - }, { - name: 'Bancor', - symbol: 'bnt', - validator: ETHValidator - }, { - name: 'Civic', - symbol: 'cvc', - validator: ETHValidator - }, { - name: 'District0x', - symbol: 'dnt', - validator: ETHValidator - }, { - name: 'Gnosis', - symbol: 'gno', - validator: ETHValidator - }, { - name: 'Golem', - symbol: 'gnt', - validator: ETHValidator - }, { - name: 'Matchpool', - symbol: 'gup', - validator: ETHValidator - }, { - name: 'Melon', - symbol: 'mln', - validator: ETHValidator - }, { - name: 'Numeraire', - symbol: 'nmr', - validator: ETHValidator - }, { - name: 'OmiseGO', - symbol: 'omg', - validator: ETHValidator - }, { - name: 'TenX', - symbol: 'pay', - validator: ETHValidator - }, { - name: 'Ripio Credit Network', - symbol: 'rcn', - validator: ETHValidator - }, { - name: 'Augur', - symbol: 'rep', - validator: ETHValidator - }, { - name: 'iExec RLC', - symbol: 'rlc', - validator: ETHValidator - }, { - name: 'Salt', - symbol: 'salt', - validator: ETHValidator - }, { - name: 'Status', - symbol: 'snt', - validator: ETHValidator - }, { - name: 'Storj', - symbol: 'storj', - validator: ETHValidator - }, { - name: 'Swarm City', - symbol: 'swt', - validator: ETHValidator - }, { - name: 'TrueUSD', - symbol: 'tusd', - validator: ETHValidator - }, { - name: 'Wings', - symbol: 'wings', - validator: ETHValidator - }, { - name: '0x', - symbol: 'zrx', - validator: ETHValidator - }, { - name: 'Expanse', - symbol: 'exp', - validator: ETHValidator - }, { - name: 'Viberate', - symbol: 'vib', - validator: ETHValidator - }, { - name: 'Odyssey', - symbol: 'ocn', - validator: ETHValidator - }, { - name: 'Polymath', - symbol: 'poly', - validator: ETHValidator - }, { - name: 'Storm', - symbol: 'storm', - validator: ETHValidator - }, { - name: 'Nano', - symbol: 'nano', - validator: NANOValidator, - }, { - name: 'RaiBlocks', - symbol: 'xrb', - validator: NANOValidator, - }, { - name: 'Siacoin', - symbol: 'sc', - validator: SCValidator - }, { - name: 'HyperSpace', - symbol: 'xsc', - validator: SCValidator - }, { - name: 'loki', - symbol: 'loki', - addressTypes: { prod: ['114', '116'], testnet: [] }, - iAddressTypes: { prod: ['115'], testnet: [] }, - validator: XMRValidator - }, { - name: 'LBRY Credits', - symbol: 'lbc', - addressTypes: { prod: ['55'], testnet: [] }, - validator: BTCValidator - }, { +var CURRENCIES = [{ + name: 'Bitcoin', + symbol: 'btc', + addressTypes: { prod: ['00', '05'], testnet: ['6f', 'c4', '3c', '26'] }, + validator: BTCValidator +}, { + name: 'BitcoinCash', + symbol: 'bch', + regexp: '^[qQpP]{1}[0-9a-zA-Z]{41}$', + addressTypes: { prod: ['00', '05'], testnet: ['6f', 'c4'] }, + validator: BCHValidator +}, { + name: 'Bitcoin SV', + symbol: 'bsv', + regexp: '^[qQ]{1}[0-9a-zA-Z]{41}$', + addressTypes: { prod: ['00', '05'], testnet: ['6f', 'c4'] }, + validator: BCHValidator +}, { + name: 'LiteCoin', + symbol: 'ltc', + addressTypes: { prod: ['30', '05', '32'], testnet: ['6f', 'c4', '3a'] }, + validator: BTCValidator +}, { + name: 'PeerCoin', + symbol: 'ppc', + addressTypes: { prod: ['37', '75'], testnet: ['6f', 'c4'] }, + validator: BTCValidator +}, { + name: 'DogeCoin', + symbol: 'doge', + addressTypes: { prod: ['1e', '16'], testnet: ['71', 'c4'] }, + validator: BTCValidator +}, { + name: 'BeaverCoin', + symbol: 'bvc', + addressTypes: { prod: ['19', '05'], testnet: ['6f', 'c4'] }, + validator: BTCValidator, +}, { + name: 'FreiCoin', + symbol: 'frc', + addressTypes: { prod: ['00', '05'], testnet: ['6f', 'c4'] }, + validator: BTCValidator +}, { + name: 'ProtoShares', + symbol: 'pts', + addressTypes: { prod: ['38', '05'], testnet: ['6f', 'c4'] }, + validator: BTCValidator +}, { + name: 'MegaCoin', + symbol: 'mec', + addressTypes: { prod: ['32', '05'], testnet: ['6f', 'c4'] }, + validator: BTCValidator +}, { + name: 'PrimeCoin', + symbol: 'xpm', + addressTypes: { prod: ['17', '53'], testnet: ['6f', 'c4'] }, + validator: BTCValidator +}, { + name: 'AuroraCoin', + symbol: 'aur', + addressTypes: { prod: ['17', '05'], testnet: ['6f', 'c4'] }, + validator: BTCValidator +}, { + name: 'NameCoin', + symbol: 'nmc', + addressTypes: { prod: ['34'], testnet: [] }, + validator: BTCValidator +}, { + name: 'BioCoin', + symbol: 'bio', + addressTypes: { prod: ['19', '14'], testnet: ['6f', 'c4'] }, + validator: BTCValidator +}, { + name: 'GarliCoin', + symbol: 'grlc', + addressTypes: { prod: ['26', '05'], testnet: ['6f', 'c4'] }, + validator: BTCValidator +}, { + name: 'VertCoin', + symbol: 'vtc', + addressTypes: { prod: ['0x', '47', '71', '05'], testnet: ['6f', 'c4'] }, + validator: BTCValidator + +}, { + name: 'BitcoinGold', + symbol: 'btg', + addressTypes: { prod: ['26', '17'], testnet: ['6f', 'c4'] }, + validator: BTCValidator +}, { + name: 'Komodo', + symbol: 'kmd', + addressTypes: { prod: ['3c', '55'], testnet: ['0', '5'] }, + validator: BTCValidator +}, { + name: 'BitcoinZ', + symbol: 'btcz', + expectedLength: 26, + addressTypes: { prod: ['1cb8', '1cbd'], testnet: ['1d25', '1cba'] }, + validator: BTCValidator +}, { + name: 'BitcoinPrivate', + symbol: 'btcp', + expectedLength: 26, + addressTypes: { prod: ['1325', '13af'], testnet: ['1957', '19e0'] }, + validator: BTCValidator +}, { + name: 'Hush', + symbol: 'hush', + expectedLength: 26, + addressTypes: { prod: ['1cb8', '1cbd'], testnet: ['1d25', '1cba'] }, + validator: BTCValidator +}, { + name: 'SnowGem', + symbol: 'sng', + expectedLength: 26, + addressTypes: { prod: ['1c28', '1c2d'], testnet: ['1d25', '1cba'] }, + validator: BTCValidator +}, { + name: 'ZCash', + symbol: 'zec', + expectedLength: 26, + addressTypes: { prod: ['1cb8', '1cbd'], testnet: ['1d25', '1cba'] }, + validator: BTCValidator +}, { + name: 'ZClassic', + symbol: 'zcl', + expectedLength: 26, + addressTypes: { prod: ['1cb8', '1cbd'], testnet: ['1d25', '1cba'] }, + validator: BTCValidator +}, { + name: 'ZenCash', + symbol: 'zen', + expectedLength: 26, + addressTypes: { prod: ['2089', '2096'], testnet: ['2092', '2098'] }, + validator: BTCValidator +}, { + name: 'VoteCoin', + symbol: 'vot', + expectedLength: 26, + addressTypes: { prod: ['1cb8', '1cbd'], testnet: ['1d25', '1cba'] }, + validator: BTCValidator +}, { + name: 'Decred', + symbol: 'dcr', + addressTypes: { prod: ['073f', '071a'], testnet: ['0f21', '0efc'] }, + hashFunction: 'blake256', + expectedLength: 26, + validator: BTCValidator +}, { + name: 'GameCredits', + symbol: 'game', + addressTypes: { prod: ['26', '05'], testnet: [] }, + validator: BTCValidator +}, { + name: 'PIVX', + symbol: 'pivx', + addressTypes: { prod: ['1e', '0d'], testnet: [] }, + validator: BTCValidator +}, { + name: 'SolarCoin', + symbol: 'slr', + addressTypes: { prod: ['12', '05'], testnet: [] }, + validator: BTCValidator +}, { + name: 'MonaCoin', + symbol: 'mona', + addressTypes: { prod: ['32', '37'], testnet: [] }, + validator: BTCValidator +}, { + name: 'DigiByte', + symbol: 'dgb', + addressTypes: { prod: ['1e'], testnet: [] }, + validator: BTCValidator +}, { + name: 'Tether', + symbol: 'usdt', + addressTypes: { prod: ['00', '05'], testnet: ['6f', 'c4'] }, + validator: BTCValidator +}, { + name: 'Ripple', + symbol: 'xrp', + validator: XRPValidator, +}, { + name: 'Dash', + symbol: 'dash', + addressTypes: { prod: ['4c', '10'], testnet: ['8c', '13'] }, + validator: BTCValidator +}, { + name: 'Neo', + symbol: 'neo', + addressTypes: { prod: ['17'], testnet: [] }, + validator: BTCValidator +}, { + name: 'NeoGas', + symbol: 'gas', + addressTypes: { prod: ['17'], testnet: [] }, + validator: BTCValidator +}, { + name: 'Qtum', + symbol: 'qtum', + addressTypes: { prod: ['3a', '32'], testnet: ['78', '6e'] }, + validator: BTCValidator +}, { + name: 'Waves', + symbol: 'waves', + addressTypes: { prod: ['0157'], testnet: ['0154'] }, + expectedLength: 26, + hashFunction: 'blake256keccak256', + regex: /^[a-zA-Z0-9]{35}$/, + validator: BTCValidator +}, { + name: 'Ethereum', + symbol: 'eth', + validator: ETHValidator, +}, { + name: 'EtherZero', + symbol: 'etz', + validator: ETHValidator, +}, { + name: 'EthereumClassic', + symbol: 'etc', + validator: ETHValidator, +}, { + name: 'Callisto', + symbol: 'clo', + validator: ETHValidator, +}, { + name: 'Bankex', + symbol: 'bkx', + validator: ETHValidator +}, { + name: 'Cardano', + symbol: 'ada', + validator: ADAValidator +}, { + name: 'Monero', + symbol: 'xmr', + addressTypes: { prod: ['18', '42'], testnet: ['53', '63'], stagenet: ['24'] }, + iAddressTypes: { prod: ['19'], testnet: ['54'], stagenet: ['25'] }, + validator: XMRValidator +}, { + name: 'Aragon', + symbol: 'ant', + validator: ETHValidator +}, { + name: 'Basic Attention Token', + symbol: 'bat', + validator: ETHValidator +}, { + name: 'Bancor', + symbol: 'bnt', + validator: ETHValidator +}, { + name: 'Civic', + symbol: 'cvc', + validator: ETHValidator +}, { + name: 'District0x', + symbol: 'dnt', + validator: ETHValidator +}, { + name: 'Gnosis', + symbol: 'gno', + validator: ETHValidator +}, { + name: 'Golem', + symbol: 'gnt', + validator: ETHValidator +}, { + name: 'Matchpool', + symbol: 'gup', + validator: ETHValidator +}, { + name: 'Melon', + symbol: 'mln', + validator: ETHValidator +}, { + name: 'Numeraire', + symbol: 'nmr', + validator: ETHValidator +}, { + name: 'OmiseGO', + symbol: 'omg', + validator: ETHValidator +}, { + name: 'TenX', + symbol: 'pay', + validator: ETHValidator +}, { + name: 'Ripio Credit Network', + symbol: 'rcn', + validator: ETHValidator +}, { + name: 'Augur', + symbol: 'rep', + validator: ETHValidator +}, { + name: 'iExec RLC', + symbol: 'rlc', + validator: ETHValidator +}, { + name: 'Salt', + symbol: 'salt', + validator: ETHValidator +}, { + name: 'Status', + symbol: 'snt', + validator: ETHValidator +}, { + name: 'Storj', + symbol: 'storj', + validator: ETHValidator +}, { + name: 'Swarm City', + symbol: 'swt', + validator: ETHValidator +}, { + name: 'TrueUSD', + symbol: 'tusd', + validator: ETHValidator +}, { + name: 'Wings', + symbol: 'wings', + validator: ETHValidator +}, { + name: '0x', + symbol: 'zrx', + validator: ETHValidator +}, { + name: 'Expanse', + symbol: 'exp', + validator: ETHValidator +}, { + name: 'Viberate', + symbol: 'vib', + validator: ETHValidator +}, { + name: 'Odyssey', + symbol: 'ocn', + validator: ETHValidator +}, { + name: 'Polymath', + symbol: 'poly', + validator: ETHValidator +}, { + name: 'Storm', + symbol: 'storm', + validator: ETHValidator +}, { + name: 'Nano', + symbol: 'nano', + validator: NANOValidator, +}, { + name: 'RaiBlocks', + symbol: 'xrb', + validator: NANOValidator, +}, { + name: 'Siacoin', + symbol: 'sc', + validator: SCValidator +}, { + name: 'HyperSpace', + symbol: 'xsc', + validator: SCValidator +}, { + name: 'loki', + symbol: 'loki', + addressTypes: { prod: ['114', '115', '116'], testnet: [] }, + iAddressTypes: { prod: ['115'], testnet: [] }, + validator: XMRValidator +}, { + name: 'LBRY Credits', + symbol: 'lbc', + addressTypes: { prod: ['55'], testnet: [] }, + validator: BTCValidator +}, { name: 'Tron', - symbol: 'trx', - addressTypes: { prod: [0x41], testnet: [0xa0] }, - validator: TRXValidator - }, { + symbol: 'trx', + addressTypes: { prod: [0x41], testnet: [0xa0] }, + validator: TRXValidator +}, { name: 'Nem', - symbol: 'xem', - validator: NEMValidator - }, { + symbol: 'xem', + validator: NEMValidator +}, { name: 'Lisk', - symbol: 'lsk', - validator: LSKValidator - }, { + symbol: 'lsk', + validator: LSKValidator +}, { name: 'Stellar', - symbol: 'xlm', - validator: XLMValidator, + symbol: 'xlm', + validator: XLMValidator, }, { name: 'BTU Protocol', symbol: 'btu', @@ -11903,7 +11280,7 @@ module.exports = { -},{"./ada_validator":124,"./bch_validator":125,"./bitcoin_validator":126,"./eos_validator":138,"./ethereum_validator":139,"./lisk_validator":140,"./monero_validator":141,"./nano_validator":142,"./nem_validator":143,"./ripple_validator":144,"./siacoin_validator":145,"./stellar_validator":146,"./tezos_validator":147,"./tron_validator":148}],138:[function(require,module,exports){ +},{"./ada_validator":36,"./bch_validator":37,"./bitcoin_validator":38,"./eos_validator":50,"./ethereum_validator":51,"./lisk_validator":52,"./monero_validator":53,"./nano_validator":54,"./nem_validator":55,"./ripple_validator":56,"./siacoin_validator":57,"./stellar_validator":58,"./tezos_validator":59,"./tron_validator":60}],50:[function(require,module,exports){ function isValidEOSAddress (address, currency, networkType) { var regex = /^[a-z0-9]+$/g // Must be numbers and lowercase letters only if (address.search(regex) !== -1 && address.length === 12) { @@ -11919,7 +11296,7 @@ module.exports = { } } -},{}],139:[function(require,module,exports){ +},{}],51:[function(require,module,exports){ var cryptoUtils = require('./crypto/utils'); module.exports = { @@ -11955,7 +11332,7 @@ module.exports = { } }; -},{"./crypto/utils":136}],140:[function(require,module,exports){ +},{"./crypto/utils":48}],52:[function(require,module,exports){ (function (Buffer){ var cryptoUtils = require('./crypto/utils'); @@ -11977,7 +11354,7 @@ module.exports = { } }; }).call(this,require("buffer").Buffer) -},{"./crypto/utils":136,"buffer":4}],141:[function(require,module,exports){ +},{"./crypto/utils":48,"buffer":4}],53:[function(require,module,exports){ var cryptoUtils = require('./crypto/utils') var cnBase58 = require('./crypto/cnBase58') @@ -12001,8 +11378,10 @@ function validateNetwork(decoded, currency, networkType, addressType) { return network.prod.indexOf(at) >= 0 case 'testnet': return network.testnet.indexOf(at) >= 0 + case 'stagenet': + return network.stagenet.indexOf(at) >= 0 case 'both': - return network.prod.indexOf(at) >= 0 || network.testnet.indexOf(at) >= 0 + return network.prod.indexOf(at) >= 0 || network.testnet.indexOf(at) >= 0 || network.stagenet.indexOf(at) >= 0 default: return false } @@ -12041,7 +11420,7 @@ module.exports = { } } -},{"./crypto/cnBase58":133,"./crypto/utils":136}],142:[function(require,module,exports){ +},{"./crypto/cnBase58":45,"./crypto/utils":48}],54:[function(require,module,exports){ var cryptoUtils = require('./crypto/utils'); var baseX = require('base-x'); @@ -12070,7 +11449,7 @@ module.exports = { } }; -},{"./crypto/utils":136,"base-x":1}],143:[function(require,module,exports){ +},{"./crypto/utils":48,"base-x":1}],55:[function(require,module,exports){ (function (Buffer){ var cryptoUtils = require('./crypto/utils'); @@ -12096,7 +11475,7 @@ module.exports = { isValidAddress: isValidAddress, } }).call(this,require("buffer").Buffer) -},{"./crypto/utils":136,"buffer":4}],144:[function(require,module,exports){ +},{"./crypto/utils":48,"buffer":4}],56:[function(require,module,exports){ var cryptoUtils = require('./crypto/utils'); var baseX = require('base-x'); @@ -12126,9 +11505,9 @@ module.exports = { } }; -},{"./crypto/utils":136,"base-x":1}],145:[function(require,module,exports){ +},{"./crypto/utils":48,"base-x":1}],57:[function(require,module,exports){ var cryptoUtils = require('./crypto/utils') -var isEqual = require('lodash/isEqual') +var isEqual = require('lodash.isequal') function hexToBytes(hex) { var bytes = [] @@ -12156,7 +11535,7 @@ module.exports = { } } -},{"./crypto/utils":136,"lodash/isEqual":113}],146:[function(require,module,exports){ +},{"./crypto/utils":48,"lodash.isequal":33}],58:[function(require,module,exports){ var baseX = require('base-x'); var crc = require('crc'); var cryptoUtils = require('./crypto/utils'); @@ -12203,7 +11582,7 @@ var ed25519PublicKeyVersionByte = (6 << 3); return computedChecksum === checksum } }; -},{"./crypto/utils":136,"base-x":1,"crc":30}],147:[function(require,module,exports){ +},{"./crypto/utils":48,"base-x":1,"crc":30}],59:[function(require,module,exports){ const base58 = require('./crypto/base58'); const cryptoUtils = require('./crypto/utils'); @@ -12241,7 +11620,7 @@ module.exports = { isValidAddress }; -},{"./crypto/base58":128,"./crypto/utils":136}],148:[function(require,module,exports){ +},{"./crypto/base58":40,"./crypto/utils":48}],60:[function(require,module,exports){ var cryptoUtils = require('./crypto/utils'); function decodeBase58Address(base58Sting) { @@ -12303,7 +11682,7 @@ module.exports = { return getEnv(currency, networkType) === address[0]; } }; -},{"./crypto/utils":136}],149:[function(require,module,exports){ +},{"./crypto/utils":48}],61:[function(require,module,exports){ var currencies = require('./currencies'); var DEFAULT_CURRENCY_NAME = 'bitcoin'; @@ -12326,5 +11705,5 @@ module.exports = { } }; -},{"./currencies":137}]},{},[149])(149) +},{"./currencies":49}]},{},[61])(61) }); diff --git a/dist/wallet-address-validator.min.js b/dist/wallet-address-validator.min.js index f79b3a74..359b32e8 100644 --- a/dist/wallet-address-validator.min.js +++ b/dist/wallet-address-validator.min.js @@ -1 +1 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).WAValidator=t()}}(function(){return function(){return function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){return o(e[a][1][t]||t)},c,c.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a=255)throw new TypeError("Alphabet too long");var e=new Uint8Array(256);e.fill(255);for(var r=0;r>>0,c=new Uint8Array(f);t[r];){var l=e[t.charCodeAt(r)];if(255===l)return;for(var h=0,p=f-1;(0!==l||h>>0,c[p]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=h,r++}if(" "!==t[r]){for(var d=f-i;d!==f&&0===c[d];)d++;var v=n.allocUnsafe(o+(f-d));v.fill(0,0,o);for(var y=o;d!==f;)v[y++]=c[d++];return v}}}return{encode:function(e){if(!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,o=0,i=0,u=e.length;i!==u&&0===e[i];)i++,r++;for(var c=(u-i)*f+1>>>0,l=new Uint8Array(c);i!==u;){for(var h=e[i],p=0,d=c-1;(0!==h||p>>0,l[d]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");o=p,i++}for(var v=c-o;v!==c&&0===l[v];)v++;for(var y=s.repeat(r);v0?n-4:n,l=0;l>16&255,s[u++]=e>>8&255,s[u++]=255&e;2===a&&(e=o[t.charCodeAt(l)]<<2|o[t.charCodeAt(l+1)]>>4,s[u++]=255&e);1===a&&(e=o[t.charCodeAt(l)]<<10|o[t.charCodeAt(l+1)]<<4|o[t.charCodeAt(l+2)]>>2,s[u++]=e>>8&255,s[u++]=255&e);return s},r.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,s=r-o;as?s:a+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var o,i,a=[],s=e;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},{}],3:[function(t,e,r){(function(t){var r,n=20,o=4,i=-7,a=21,s=-1e9,u=1e9,f=!0,c=parseInt,l=g.prototype,h="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",p=0,d=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,v=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},y=g(1);function g(t,e){var i,a,c,l,y,m,w=this;if(!(w instanceof g))return new g(t,e);if(t instanceof g){if(p=0,e===i)return w.s=t.s,w.e=t.e,void(w.c=(t=t.c)?t.slice():t);t+=""}if("string"!=typeof t&&(t=(c="number"==typeof t||"[object Number]"==Object.prototype.toString.call(t))&&0===t&&1/t<0?"-0":t+""),m=t,e===i&&d.test(t))w.s="-"==t.charAt(0)?(t=t.slice(1),-1):1;else{if(10==e)return x(t,n,o);if(t=v.call(t).replace(/^\+(?!-)/,""),w.s="-"==t.charAt(0)?(t=t.replace(/^-(?!-)/,""),-1):1,null!=e?e!=(0|e)&&f||(r=!(e>=2&&e<65))?(b(e,2),y=d.test(t)):(l="["+h.slice(0,e|=0)+"]+",t=t.replace(/\.$/,"").replace(/^\./,"0."),(y=new RegExp("^"+l+"(?:\\."+l+")?$",e<37?"i":"").test(t))?(c&&(t.replace(/^0\.0*|\./,"").length>15&&b(m,0),c=!c),t=_(t,10,e,w.s)):"Infinity"!=t&&"NaN"!=t&&(b(m,1,e),t="NaN")):y=d.test(t),!y)return w.c=w.e=null,"Infinity"!=t&&("NaN"!=t&&b(m,3),w.s=null),void(p=0)}for((i=t.indexOf("."))>-1&&(t=t.replace(".","")),(a=t.search(/e/i))>0?(i<0&&(i=a),i+=+t.slice(a+1),t=t.substring(0,a)):i<0&&(i=t.length),a=0;"0"==t.charAt(a);a++);if(e=t.length,c&&e>15&&t.slice(a).length>15&&b(m,0),p=0,(i-=a+1)>u)w.c=w.e=null;else if(a==e||ie-1&&(null==u[o+1]&&(u[o+1]=0),u[o+1]+=u[o]/e^0,u[o]%=e)}return u.reverse()}function l(t){for(var e=0,r=t.length,n="";e-1)if(o=t.length-o-1,i=c(new g(r).pow(o).toF(),10),a=c((s=t.split("."))[1]),s=c(s[0]),u=(f=m(a,i,a.length-i.length,n,e,1&s[s.length-1])).c,o=f.e){for(;++o;u.unshift(0));t=l(s)+"."+l(u)}else u[0]?s[o=s.length-1]m?1:-1;else for(p=-1,h=0;++p_[p]?1:-1;break}if(!(h<0))break;for(c=m==f?e:d;m;){if(_[--m]C&&A(w,n,i,a,null!=_[0]),w.e>u?w.c=w.e=null:w.e++e&&A(t,n,10),n=0==o[0]?n+1:r?e:t.e+n+1;o.length1?(o.splice(1,0,"."),o.join("")):o[0])+(n<0?"e":"e+")+n:t.toS()}function A(t,e,r,n,i){var a=t.c,s=t.s<0,u=r/2,f=t.e+e+1,c=a[f],l=i||f<0||null!=a[f+1];if(i=o<4?(null!=c||l)&&(0==o||2==o&&!s||3==o&&s):c>u||c==u&&(4==o||l||6==o&&(1&a[f-1]||!e&&n)||7==o&&!s||8==o&&s),f<1||!a[0])return a.length=0,a.push(0),i?(a[0]=1,t.e=-e):t.e=0,t;if(a.length=f--,i)for(--r;++a[f]>r;)a[f]=0,f--||(++t.e,a.unshift(1));for(f=a.length;!a[--f];a.pop());return t}function x(t,e,r){var n=o;return o=r,(t=new g(t)).c&&A(t,e,10),o=n,t}g.ROUND_UP=0,g.ROUND_DOWN=1,g.ROUND_CEIL=2,g.ROUND_FLOOR=3,g.ROUND_HALF_UP=4,g.ROUND_HALF_DOWN=5,g.ROUND_HALF_EVEN=6,g.ROUND_HALF_CEIL=7,g.ROUND_HALF_FLOOR=8,g.fromBuffer=function(t,e){e||(e={});var r={1:"big","-1":"little"}[e.endian]||e.endian||"big",n="auto"===e.size?Math.ceil(t.length):e.size||1;if(t.length%n!=0)throw new RangeError("Buffer length ("+t.length+") must be a multiple of size ("+n+")");for(var o=[],i=0;in)||c(t)!=t&&0!==t)},_=v&&"object"==typeof v?function(){if(v.hasOwnProperty(e))return null!=(t=v[e])}:function(){if(d.length>l)return null!=(t=d[l++])};return _(e="DECIMAL_PLACES")&&(g(t,0,1e9)?n=0|t:b(t,e,y)),h[e]=n,_(e="ROUNDING_MODE")&&(g(t,0,8)?o=0|t:b(t,e,y)),h[e]=o,_(e="EXPONENTIAL_AT")&&(g(t,-1e9,1e9)?i=-(a=~~(t<0?-t:+t)):!r&&t&&g(t[0],-1e9,0)&&g(t[1],0,1e9)?(i=~~t[0],a=~~t[1]):b(t,e,y,1)),h[e]=[i,a],_(e="RANGE")&&(g(t,-1e9,1e9)&&~~t?s=-(u=~~(t<0?-t:+t)):!r&&t&&g(t[0],-1e9,-1)&&g(t[1],1,1e9)?(s=~~t[0],u=~~t[1]):b(t,e,y,1,1)),h[e]=[s,u],_(e="ERRORS")&&(t===!!t||1===t||0===t?(r=p=0,c=(f=!!t)?parseInt:parseFloat):b(t,e,y,0,0,1)),h[e]=f,h},l.abs=l.absoluteValue=function(){var t=new g(this);return t.s<0&&(t.s=1),t},l.bitLength=function(){return this.toString(2).length},l.ceil=function(){return x(this,0,2)},l.comparedTo=l.cmp=function(t,e){var r,n=this,o=n.c,i=(p=-p,t=new g(t,e)).c,a=n.s,s=t.s,u=n.e,f=t.e;if(!a||!s)return null;if(r=o&&!o[0],e=i&&!i[0],r||e)return r?e?0:-s:a;if(a!=s)return a;if(r=a<0,e=u==f,!o||!i)return e?0:!o^r?1:-1;if(!e)return u>f^r?1:-1;for(a=-1,s=(u=o.length)<(f=i.length)?u:f;++ai[a]^r?1:-1;return u==f?0:u>f^r?1:-1},l.dividedBy=l.div=function(t,e){var r=this.c,n=this.e,o=this.s,i=(p=2,t=new g(t,e)).c,a=t.e,s=t.s,u=o==s?1:-1;return(n||r&&r[0])&&(a||i&&i[0])?m(r,i,n-a,u,10):new g(o&&s&&(r?!i||r[0]!=i[0]:i)?r&&0==r[0]||!i?0*u:u/0:NaN)},l.equals=l.eq=function(t,e){return p=3,0===this.cmp(t,e)},l.floor=function(){return x(this,0,3)},l.greaterThan=l.gt=function(t,e){return p=4,this.cmp(t,e)>0},l.greaterThanOrEqualTo=l.gte=l.gt=function(t,e){return p=5,1==(e=this.cmp(t,e))||0===e},l.isFinite=l.isF=function(){return!!this.c},l.isNaN=function(){return!this.s},l.isNegative=l.isNeg=function(){return this.s<0},l.isZero=l.isZ=function(){return!!this.c&&0==this.c[0]},l.lessThan=l.lt=function(t,e){return p=6,this.cmp(t,e)<0},l.lessThanOrEqualTo=l.lte=l.le=function(t,e){return p=7,-1==(e=this.cmp(t,e))||0===e},l.minus=l.sub=function(t,e){var r,n,i,a,u=this,f=u.s;if(e=(p=8,t=new g(t,e)).s,!f||!e)return new g(NaN);if(f!=e)return t.s=-e,u.plus(t);var c=u.c,l=u.e,h=t.c,d=t.e;if(!l||!d){if(!c||!h)return c?(t.s=-e,t):new g(h?u:NaN);if(!c[0]||!h[0])return h[0]?(t.s=-e,t):new g(c[0]?u:3==o?-0:0)}if(c=c.slice(),f=l-d){for((r=(a=f<0)?(f=-f,c):(d=l,h)).reverse(),e=f;e--;r.push(0));r.reverse()}else for(i=((a=c.length0)for(;e--;c[i++]=0);for(e=h.length;e>f;){if(c[--e]0?(s=i,f):(o=-o,a)).reverse();o--;r.push(0));r.reverse()}for(a.length-f.length<0&&(r=f,f=a,a=r),o=f.length,e=0;o;e=(a[--o]=a[o]+f[o]+e)/10^0,a[o]%=10);for(e&&(a.unshift(e),++s>u&&(a=s=null)),o=a.length;0==a[--o];a.pop());return t.c=a,t.e=s,t},l.toPower=l.pow=function(t){var e=0*t==0?0|t:t,n=new g(this),o=new g(y);if(((r=t<-1e6||t>1e6)&&(e=1*t/0)||c(t)!=t&&0!==t&&!(e=NaN))&&!b(t,"exponent","pow")||!e)return new g(Math.pow(n.toS(),e));for(e=e<0?-e:e;1&e&&(o=o.times(n)),e>>=1;)n=n.times(n);return t<0?y.div(o):o},l.powm=function(t,e){return this.pow(t).mod(e)},l.round=function(t,e){return x(this,t=null==t||((r=t<0||t>1e9)||c(t)!=t)&&!b(t,"decimal places","round")?0:0|t,e=null==e||((r=e<0||e>8)||c(e)!=e&&0!==e)&&!b(e,"mode","round")?o:0|e)},l.squareRoot=l.sqrt=function(){var t,e,r,i,a=this,s=a.c,u=a.s,f=a.e,c=n,l=o,h=new g("0.5");if(1!==u||!s||!s[0])return new g(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);for(u=Math.sqrt(a.toS()),o=1,0==u||u==1/0?((t=s.join("")).length+f&1||(t+="0"),(e=new g(Math.sqrt(t)+"")).c||(e.c=[1]),e.e=((f+1)/2|0)-(f<0||1&f)):e=new g(t=u.toString()),(u=(r=e.e)+(n+=4))<3&&(u=0),f=u;;)if(i=e,e=h.times(i.plus(a.div(i))),i.c.slice(0,u).join("")===e.c.slice(0,u).join("")){if(9!=(s=e.c)[u-=t&&e.ef-2&&(s.length=f-2),e.times(e).eq(a)))){for(;s.length-1;a--){for(e=0,f=c+a;f>a;e=r[f]+i[a]*o[f-a-1]+e,r[f--]=e%10|0,e=e/10|0);e&&(r[f]=(r[f]+e)%10)}for(e&&++t.e,!r[0]&&r.shift(),f=r.length;!r[--f];r.pop());return t.c=t.e>u?t.e=null:t.e0&&c.copy(o,4+(128&c[0]?1:0)),128&c[0]&&(o[4]=0),o[0]=n&255<<24,o[1]=n&255<<16,o[2]=65280&n,o[3]=255&n;var i=this.lt(0);if(i)for(var a=4;a0}).forEach(function(t,e){for(var r=0;r1e9)||c(t)!=t&&0!==t)&&!b(t,"decimal places","toE"))&&this.c?this.c.length-1:0|t,1)},l.toFixed=l.toF=function(t){var e,n,o,s=this;return null==t||((r=t<0||t>1e9)||c(t)!=t&&0!==t)&&!b(t,"decimal places","toF")||(o=s.e+(0|t)),e=i,t=a,i=-(a=1/0),o==n?n=s.toS():(n=w(s,o),s.s<0&&s.c&&(s.c[0]?n.indexOf("-")<0&&(n="-"+n):n=n.replace(/^-/,""))),i=e,a=t,n},l.toFraction=l.toFr=function(t){var e,i,a,s,c,l,h,d=s=new g(y),v=a=new g("0"),_=this,m=_.c,w=u,A=n,x=o,E=new g(y);if(!m)return _.toS();for(h=E.e=m.length-_.e-1,(null==t||(!(p=12,l=new g(t)).s||(r=l.cmp(d)<0||!l.c)||f&&l.e0)&&(t=h>0?E:d),u=1/0,l=new g(m.join("")),n=0,o=1;e=l.div(E),1!=(c=s.plus(e.times(v))).cmp(t);)s=v,v=c,d=a.plus(e.times(c=d)),a=c,E=l.minus(e.times(c=E)),l=c;return c=t.minus(s).div(v),a=a.plus(c.times(d)),s=s.plus(c.times(v)),a.s=d.s=_.s,n=2*h,o=x,i=d.div(v).minus(_).abs().cmp(a.div(s).minus(_).abs())<1?[d.toS(),v.toS()]:[a.toS(),s.toS()],u=w,n=A,i},l.toPrecision=l.toP=function(t){return null==t||((r=t<1||t>1e9)||c(t)!=t)&&!b(t,"precision","toP")?this.toS():w(this,0|--t,2)},l.toString=l.toS=function(t){var e,n,o,s=this,u=s.e;if(null===u)n=s.s?"Infinity":"NaN";else{if(t===e&&(u<=i||u>=a))return w(s,s.c.length-1,1);if(n=s.c.join(""),u<0){for(;++u;n="0"+n);n="0."+n}else if(o=n.length,u>0)if(++u>o)for(u-=o;u--;n+="0");else u1)n=e+"."+n.slice(1);else if("0"==e)return e;if(null!=t)if((r=!(t>=2&&t<65))||t!=(0|t)&&f)b(t,"base","toS");else if("0"==(n=_(n,0|t,10,s.s)))return n}return s.s<0?"-"+n:n},l.valueOf=function(){return this.toS()},e.exports=g}).call(this,t("buffer").Buffer)},{buffer:4}],4:[function(t,e,r){"use strict";var n=t("base64-js"),o=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var i=2147483647;function a(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|p(t,e),n=a(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return l(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(H(t,ArrayBuffer)||t&&H(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(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=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(o)return n?-1:N(t).length;e=(""+e).toLowerCase(),o=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),z(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,o){var i,a=1,s=t.length,u=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;a=2,s/=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var c=-1;for(i=r;is&&(r=s-u),i=r;i>=0;i--){for(var l=!0,h=0;ho&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o239?4:f>223?3:f>191?2:1;if(o+l<=r)switch(l){case 1:f<128&&(c=f);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&f)<<6|63&i)>127&&(c=u);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(u=(15&f)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&f)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,l=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=l}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.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 S(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return B(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),""},s.prototype.compare=function(t,e,r,n,o){if(H(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var i=o-n,a=r-e,u=Math.min(i,a),f=this.slice(n,o),c=t.slice(e,r),l=0;l>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return m(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function B(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;on)&&(r=n);for(var o="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function U(t,e,r,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function j(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,i){return e=+e,r>>>=0,i||j(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function I(t,e,r,n,i){return e=+e,r>>>=0,i||j(t,0,r,8),o.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],o=1,i=0;++i>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||O(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||U(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n)||U(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||U(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},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||U(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},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);U(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);U(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||U(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},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.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),e||(e=0),n>0&&n=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),t.length-e=0;--i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return o},s.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&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function F(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function P(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function H(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function z(t){return t!=t}},{"base64-js":2,ieee754:31}],5:[function(t,e,r){!function(t,r){"use strict";var n=Math.pow(2,-24),o=Math.pow(2,32),i=Math.pow(2,53);var a={encode:function(t){var e,n=new ArrayBuffer(256),a=new DataView(n),s=0;function u(t){for(var r=n.byteLength,o=s+t;r>2,f=0;f>6),o.push(128|63&a)):a<55296?(o.push(224|a>>12),o.push(128|a>>6&63),o.push(128|63&a)):(a=(1023&a)<<10,a|=1023&e.charCodeAt(++n),a+=65536,o.push(240|a>>18),o.push(128|a>>12&63),o.push(128|a>>6&63),o.push(128|63&a))}return h(3,o.length),l(o);default:var p;if(Array.isArray(e))for(h(4,p=e.length),n=0;n>5!==t)throw"Invalid indefinite length element";return r}function y(t,e){for(var r=0;r>10),t.push(56320|1023&n))}}"function"!=typeof e&&(e=function(t){return t}),"function"!=typeof i&&(i=function(){return r});var g=function t(){var o,h,g=c(),b=g>>5,_=31&g;if(7===b)switch(_){case 25:return function(){var t=new ArrayBuffer(4),e=new DataView(t),r=l(),o=32768&r,i=31744&r,a=1023&r;if(31744===i)i=261120;else if(0!==i)i+=114688;else if(0!==a)return a*n;return e.setUint32(0,o<<16|i<<13|a<<13),e.getFloat32(0)}();case 26:return u(a.getFloat32(s),4);case 27:return u(a.getFloat64(s),8)}if((h=d(_))<0&&(b<2||6=0;)w+=h,m.push(f(h));var A=new Uint8Array(w),x=0;for(o=0;o=0;)y(E,h);else y(E,h);return String.fromCharCode.apply(null,E);case 4:var C;if(h<0)for(C=[];!p();)C.push(t());else for(C=new Array(h),o=0;o>8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],19:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),o=a(t("./create_buffer")),i=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[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];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,i.default)("ccitt",function(t,e){n.Buffer.isBuffer(t)||(t=(0,o.default)(t));for(var r=void 0!==e?~~e:65535,i=0;i>8^a)]^r<<8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],20:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),o=a(t("./create_buffer")),i=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[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];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,i.default)("kermit",function(t,e){n.Buffer.isBuffer(t)||(t=(0,o.default)(t));for(var r=void 0!==e?~~e:0,i=0;i>8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],21:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),o=a(t("./create_buffer")),i=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[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];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,i.default)("crc-16-modbus",function(t,e){n.Buffer.isBuffer(t)||(t=(0,o.default)(t));for(var r=void 0!==e?~~e:65535,i=0;i>8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],22:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),o=i(t("./create_buffer"));function i(t){return t&&t.__esModule?t:{default:t}}var a=(0,i(t("./define_crc")).default)("xmodem",function(t,e){n.Buffer.isBuffer(t)||(t=(0,o.default)(t));for(var r=void 0!==e?~~e:0,i=0;i>>8&255;a^=255&t[i],r=r<<8&65535,r^=a^=a>>>4,r^=a=a<<5&65535,r^=a=a<<7&65535}return r});r.default=a},{"./create_buffer":28,"./define_crc":29,buffer:4}],23:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),o=a(t("./create_buffer")),i=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[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];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,i.default)("crc-24",function(t,e){n.Buffer.isBuffer(t)||(t=(0,o.default)(t));for(var r=void 0!==e?~~e:11994318,i=0;i>16^a)]^r<<8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],24:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),o=a(t("./create_buffer")),i=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[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];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,i.default)("crc-32",function(t,e){n.Buffer.isBuffer(t)||(t=(0,o.default)(t));for(var r=0===e?0:-1^~~e,i=0;i>>8}return-1^r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],25:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),o=a(t("./create_buffer")),i=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[0,7,14,9,28,27,18,21,56,63,54,49,36,35,42,45,112,119,126,121,108,107,98,101,72,79,70,65,84,83,90,93,224,231,238,233,252,251,242,245,216,223,214,209,196,195,202,205,144,151,158,153,140,139,130,133,168,175,166,161,180,179,186,189,199,192,201,206,219,220,213,210,255,248,241,246,227,228,237,234,183,176,185,190,171,172,165,162,143,136,129,134,147,148,157,154,39,32,41,46,59,60,53,50,31,24,17,22,3,4,13,10,87,80,89,94,75,76,69,66,111,104,97,102,115,116,125,122,137,142,135,128,149,146,155,156,177,182,191,184,173,170,163,164,249,254,247,240,229,226,235,236,193,198,207,200,221,218,211,212,105,110,103,96,117,114,123,124,81,86,95,88,77,74,67,68,25,30,23,16,5,2,11,12,33,38,47,40,61,58,51,52,78,73,64,71,82,85,92,91,118,113,120,127,106,109,100,99,62,57,48,55,34,37,44,43,6,1,8,15,26,29,20,19,174,169,160,167,178,181,188,187,150,145,152,159,138,141,132,131,222,217,208,215,194,197,204,203,230,225,232,239,250,253,244,243];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,i.default)("crc-8",function(t,e){n.Buffer.isBuffer(t)||(t=(0,o.default)(t));for(var r=~~e,i=0;i1&&void 0!==arguments[1]?arguments[1]:-1;n.Buffer.isBuffer(t)||(t=(0,o.default)(t));for(var r=0===e?0:~~e,i=0;i>>8}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],28:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),o=n.Buffer.from&&n.Buffer.alloc&&n.Buffer.allocUnsafe&&n.Buffer.allocUnsafeSlow?n.Buffer.from:function(t){return new n.Buffer(t)};r.default=o},{buffer:4}],29:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t,e){var r=function(t,r){return e(t,r)>>>0};return r.signed=e,r.unsigned=r,r.model=t,r}},{}],30:[function(t,e,r){"use strict";e.exports={crc1:t("./crc1"),crc8:t("./crc8"),crc81wire:t("./crc8_1wire"),crc16:t("./crc16"),crc16ccitt:t("./crc16_ccitt"),crc16modbus:t("./crc16_modbus"),crc16xmodem:t("./crc16_xmodem"),crc16kermit:t("./crc16_kermit"),crc24:t("./crc24"),crc32:t("./crc32"),crcjam:t("./crcjam")}},{"./crc1":6,"./crc16":7,"./crc16_ccitt":8,"./crc16_kermit":9,"./crc16_modbus":10,"./crc16_xmodem":11,"./crc24":12,"./crc32":13,"./crc8":14,"./crc8_1wire":15,"./crcjam":16}],31:[function(t,e,r){r.read=function(t,e,r,n,o){var i,a,s=8*o-n-1,u=(1<>1,c=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-c)-1,p>>=-c,c+=s;c>0;i=256*i+t[e+l],l+=h,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+t[e+l],l+=h,c-=8);if(0===i)i=1-f;else{if(i===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=f}return(p?-1:1)*a*Math.pow(2,i-n)},r.write=function(t,e,r,n,o,i){var a,s,u,f=8*i-o-1,c=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=c?(s=0,a=c):a+l>=1?(s=(e*u-1)*Math.pow(2,o),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[r+p]=255&s,p+=d,s/=256,o-=8);for(a=a<0;t[r+p]=255&a,p+=d,a/=256,f-=8);t[r+p-d]|=128*v}},{}],32:[function(t,e,r){"use strict";!function(t){function n(t,e,r){var n,o,l,h,p,d,v,y,g,b=0,_=[],m=0,x=!1,E=[],C=[],B=!1;if(n=(r=r||{}).encoding||"UTF8",(g=r.numRounds||1)!==parseInt(g,10)||1>g)throw Error("numRounds must a integer >= 1");if(0!==t.lastIndexOf("SHA-",0))throw Error("Chosen SHA variant is not supported");if(d=function(e,r){return A(e,r,t)},v=function(e,r,n,o){var i,a;if("SHA-224"!==t&&"SHA-256"!==t)throw Error("Unexpected error in SHA-2 implementation");for(i=15+(r+65>>>9<<4),a=16;e.length<=i;)e.push(0);for(e[r>>>5]|=128<<24-r%32,r+=n,e[i]=4294967295&r,e[i-1]=r/4294967296|0,n=e.length,r=0;r>>3)/4-1,ae/8){for(;r.length<=i;)r.push(0);r[i]&=4294967040}for(e=0;e<=i;e+=1)E[e]=909522486^r[e],C[e]=1549556828^r[e];o=d(E,o),b=p,x=!0},this.update=function(t){var e,r,n,i=0,a=p>>>5;for(t=(e=l(t,_,m)).binLen,r=e.value,e=t>>>5,n=0;n>>5),m=t%p,B=!0},this.getHash=function(e,r){var n,c,l,p;if(!0===x)throw Error("Cannot call getHash after setting HMAC key");switch(l=f(r),e){case"HEX":n=function(t){return i(t,h,l)};break;case"B64":n=function(t){return a(t,h,l)};break;case"BYTES":n=function(t){return s(t,h)};break;case"ARRAYBUFFER":try{c=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}n=function(t){return u(t,h)};break;default:throw Error("format must be HEX, B64, BYTES, or ARRAYBUFFER")}for(p=v(_.slice(),m,b,y(o)),c=1;c>>2]>>>8*(3+n%4*-1),i+="0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o);return r.outputUpper?i.toUpperCase():i}function a(t,e,r){var n,o,i,a="",s=e/8;for(n=0;n>>2]:0,i=n+2>>2]:0,i=(t[n>>>2]>>>8*(3+n%4*-1)&255)<<16|(o>>>8*(3+(n+1)%4*-1)&255)<<8|i>>>8*(3+(n+2)%4*-1)&255,o=0;4>o;o+=1)a+=8*n+6*o<=e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>>6*(3-o)&63):r.b64Pad;return a}function s(t,e){var r,n,o="",i=e/8;for(r=0;r>>2]>>>8*(3+r%4*-1)&255,o+=String.fromCharCode(n);return o}function u(t,e){var r,n,o=e/8,i=new ArrayBuffer(o);for(n=new Uint8Array(i),r=0;r>>2]>>>8*(3+r%4*-1)&255;return i}function f(t){var e={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(t=t||{},e.outputUpper=t.outputUpper||!1,!0===t.hasOwnProperty("b64Pad")&&(e.b64Pad=t.b64Pad),"boolean"!=typeof e.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof e.b64Pad)throw Error("Invalid b64Pad formatting option");return e}function c(t,e){var r;switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(t){case"HEX":r=function(t,e,r){var n,o,i,a,s,u=t.length;if(0!=u%2)throw Error("String of HEX type must be in byte increments");for(e=e||[0],s=(r=r||0)>>>3,n=0;n>>1)+s)>>>2;e.length<=i;)e.push(0);e[i]|=o<<8*(3+a%4*-1)}return{value:e,binLen:4*u+r}};break;case"TEXT":r=function(t,r,n){var o,i,a,s,u,f,c,l,h=0;if(r=r||[0],u=(n=n||0)>>>3,"UTF8"===e)for(l=3,a=0;a(o=t.charCodeAt(a))?i.push(o):2048>o?(i.push(192|o>>>6),i.push(128|63&o)):55296>o||57344<=o?i.push(224|o>>>12,128|o>>>6&63,128|63&o):(a+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(a)),i.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),s=0;s>>2;r.length<=f;)r.push(0);r[f]|=i[s]<<8*(l+c%4*-1),h+=1}else if("UTF16BE"===e||"UTF16LE"===e)for(l=2,i="UTF16LE"===e||"UTF16LE"!==e&&!1,a=0;a>>8),f=(c=h+u)>>>2;r.length<=f;)r.push(0);r[f]|=o<<8*(l+c%4*-1),h+=2}return{value:r,binLen:8*h+n}};break;case"B64":r=function(t,e,r){var n,o,i,a,s,u,f,c=0;if(-1===t.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(o=t.indexOf("="),t=t.replace(/\=/g,""),-1!==o&&o=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r>>0,c=new Uint8Array(a);t[r];){var l=e[t.charCodeAt(r)];if(255===l)return;for(var h=0,d=a-1;(0!==l||h>>0,c[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");o=h,r++}if(" "!==t[r]){for(var p=a-o;p!==a&&0===c[p];)p++;var v=n.allocUnsafe(i+(a-p));v.fill(0,0,i);for(var y=i;p!==a;)v[y++]=c[p++];return v}}}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,a=e.length;o!==a&&0===e[o];)o++,r++;for(var f=(a-o)*c+1>>>0,l=new Uint8Array(f);o!==a;){for(var h=e[o],d=0,p=f-1;(0!==h||d>>0,l[p]=h%s>>>0,h=h/s>>>0;if(0!==h)throw new Error("Non-zero carry");i=d,o++}for(var v=f-i;v!==f&&0===l[v];)v++;for(var y=u.repeat(r);v0?n-4:n,l=0;l>16&255,s[u++]=e>>8&255,s[u++]=255&e;2===a&&(e=i[t.charCodeAt(l)]<<2|i[t.charCodeAt(l+1)]>>4,s[u++]=255&e);1===a&&(e=i[t.charCodeAt(l)]<<10|i[t.charCodeAt(l+1)]<<4|i[t.charCodeAt(l+2)]>>2,s[u++]=e>>8&255,s[u++]=255&e);return s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));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]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var i,o,a=[],s=e;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],3:[function(t,e,r){(function(t){var r,n=20,i=4,o=-7,a=21,s=-1e9,u=1e9,f=!0,c=parseInt,l=g.prototype,h="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",d=0,p=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,v=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},y=g(1);function g(t,e){var o,a,c,l,y,w,_=this;if(!(_ instanceof g))return new g(t,e);if(t instanceof g){if(d=0,e===o)return _.s=t.s,_.e=t.e,void(_.c=(t=t.c)?t.slice():t);t+=""}if("string"!=typeof t&&(t=(c="number"==typeof t||"[object Number]"==Object.prototype.toString.call(t))&&0===t&&1/t<0?"-0":t+""),w=t,e===o&&p.test(t))_.s="-"==t.charAt(0)?(t=t.slice(1),-1):1;else{if(10==e)return E(t,n,i);if(t=v.call(t).replace(/^\+(?!-)/,""),_.s="-"==t.charAt(0)?(t=t.replace(/^-(?!-)/,""),-1):1,null!=e?e!=(0|e)&&f||(r=!(e>=2&&e<65))?(b(e,2),y=p.test(t)):(l="["+h.slice(0,e|=0)+"]+",t=t.replace(/\.$/,"").replace(/^\./,"0."),(y=new RegExp("^"+l+"(?:\\."+l+")?$",e<37?"i":"").test(t))?(c&&(t.replace(/^0\.0*|\./,"").length>15&&b(w,0),c=!c),t=m(t,10,e,_.s)):"Infinity"!=t&&"NaN"!=t&&(b(w,1,e),t="NaN")):y=p.test(t),!y)return _.c=_.e=null,"Infinity"!=t&&("NaN"!=t&&b(w,3),_.s=null),void(d=0)}for((o=t.indexOf("."))>-1&&(t=t.replace(".","")),(a=t.search(/e/i))>0?(o<0&&(o=a),o+=+t.slice(a+1),t=t.substring(0,a)):o<0&&(o=t.length),a=0;"0"==t.charAt(a);a++);if(e=t.length,c&&e>15&&t.slice(a).length>15&&b(w,0),d=0,(o-=a+1)>u)_.c=_.e=null;else if(a==e||oe-1&&(null==u[i+1]&&(u[i+1]=0),u[i+1]+=u[i]/e^0,u[i]%=e)}return u.reverse()}function l(t){for(var e=0,r=t.length,n="";e-1)if(i=t.length-i-1,o=c(new g(r).pow(i).toF(),10),a=c((s=t.split("."))[1]),s=c(s[0]),u=(f=w(a,o,a.length-o.length,n,e,1&s[s.length-1])).c,i=f.e){for(;++i;u.unshift(0));t=l(s)+"."+l(u)}else u[0]?s[i=s.length-1]w?1:-1;else for(d=-1,h=0;++dm[d]?1:-1;break}if(!(h<0))break;for(c=w==f?e:p;w;){if(m[--w]B&&A(_,n,o,a,null!=m[0]),_.e>u?_.c=_.e=null:_.e++e&&A(t,n,10),n=0==i[0]?n+1:r?e:t.e+n+1;i.length1?(i.splice(1,0,"."),i.join("")):i[0])+(n<0?"e":"e+")+n:t.toS()}function A(t,e,r,n,o){var a=t.c,s=t.s<0,u=r/2,f=t.e+e+1,c=a[f],l=o||f<0||null!=a[f+1];if(o=i<4?(null!=c||l)&&(0==i||2==i&&!s||3==i&&s):c>u||c==u&&(4==i||l||6==i&&(1&a[f-1]||!e&&n)||7==i&&!s||8==i&&s),f<1||!a[0])return a.length=0,a.push(0),o?(a[0]=1,t.e=-e):t.e=0,t;if(a.length=f--,o)for(--r;++a[f]>r;)a[f]=0,f--||(++t.e,a.unshift(1));for(f=a.length;!a[--f];a.pop());return t}function E(t,e,r){var n=i;return i=r,(t=new g(t)).c&&A(t,e,10),i=n,t}g.ROUND_UP=0,g.ROUND_DOWN=1,g.ROUND_CEIL=2,g.ROUND_FLOOR=3,g.ROUND_HALF_UP=4,g.ROUND_HALF_DOWN=5,g.ROUND_HALF_EVEN=6,g.ROUND_HALF_CEIL=7,g.ROUND_HALF_FLOOR=8,g.fromBuffer=function(t,e){e||(e={});var r={1:"big","-1":"little"}[e.endian]||e.endian||"big",n="auto"===e.size?Math.ceil(t.length):e.size||1;if(t.length%n!=0)throw new RangeError("Buffer length ("+t.length+") must be a multiple of size ("+n+")");for(var i=[],o=0;on)||c(t)!=t&&0!==t)},m=v&&"object"==typeof v?function(){if(v.hasOwnProperty(e))return null!=(t=v[e])}:function(){if(p.length>l)return null!=(t=p[l++])};return m(e="DECIMAL_PLACES")&&(g(t,0,1e9)?n=0|t:b(t,e,y)),h[e]=n,m(e="ROUNDING_MODE")&&(g(t,0,8)?i=0|t:b(t,e,y)),h[e]=i,m(e="EXPONENTIAL_AT")&&(g(t,-1e9,1e9)?o=-(a=~~(t<0?-t:+t)):!r&&t&&g(t[0],-1e9,0)&&g(t[1],0,1e9)?(o=~~t[0],a=~~t[1]):b(t,e,y,1)),h[e]=[o,a],m(e="RANGE")&&(g(t,-1e9,1e9)&&~~t?s=-(u=~~(t<0?-t:+t)):!r&&t&&g(t[0],-1e9,-1)&&g(t[1],1,1e9)?(s=~~t[0],u=~~t[1]):b(t,e,y,1,1)),h[e]=[s,u],m(e="ERRORS")&&(t===!!t||1===t||0===t?(r=d=0,c=(f=!!t)?parseInt:parseFloat):b(t,e,y,0,0,1)),h[e]=f,h},l.abs=l.absoluteValue=function(){var t=new g(this);return t.s<0&&(t.s=1),t},l.bitLength=function(){return this.toString(2).length},l.ceil=function(){return E(this,0,2)},l.comparedTo=l.cmp=function(t,e){var r,n=this,i=n.c,o=(d=-d,t=new g(t,e)).c,a=n.s,s=t.s,u=n.e,f=t.e;if(!a||!s)return null;if(r=i&&!i[0],e=o&&!o[0],r||e)return r?e?0:-s:a;if(a!=s)return a;if(r=a<0,e=u==f,!i||!o)return e?0:!i^r?1:-1;if(!e)return u>f^r?1:-1;for(a=-1,s=(u=i.length)<(f=o.length)?u:f;++ao[a]^r?1:-1;return u==f?0:u>f^r?1:-1},l.dividedBy=l.div=function(t,e){var r=this.c,n=this.e,i=this.s,o=(d=2,t=new g(t,e)).c,a=t.e,s=t.s,u=i==s?1:-1;return(n||r&&r[0])&&(a||o&&o[0])?w(r,o,n-a,u,10):new g(i&&s&&(r?!o||r[0]!=o[0]:o)?r&&0==r[0]||!o?0*u:u/0:NaN)},l.equals=l.eq=function(t,e){return d=3,0===this.cmp(t,e)},l.floor=function(){return E(this,0,3)},l.greaterThan=l.gt=function(t,e){return d=4,this.cmp(t,e)>0},l.greaterThanOrEqualTo=l.gte=l.gt=function(t,e){return d=5,1==(e=this.cmp(t,e))||0===e},l.isFinite=l.isF=function(){return!!this.c},l.isNaN=function(){return!this.s},l.isNegative=l.isNeg=function(){return this.s<0},l.isZero=l.isZ=function(){return!!this.c&&0==this.c[0]},l.lessThan=l.lt=function(t,e){return d=6,this.cmp(t,e)<0},l.lessThanOrEqualTo=l.lte=l.le=function(t,e){return d=7,-1==(e=this.cmp(t,e))||0===e},l.minus=l.sub=function(t,e){var r,n,o,a,u=this,f=u.s;if(e=(d=8,t=new g(t,e)).s,!f||!e)return new g(NaN);if(f!=e)return t.s=-e,u.plus(t);var c=u.c,l=u.e,h=t.c,p=t.e;if(!l||!p){if(!c||!h)return c?(t.s=-e,t):new g(h?u:NaN);if(!c[0]||!h[0])return h[0]?(t.s=-e,t):new g(c[0]?u:3==i?-0:0)}if(c=c.slice(),f=l-p){for((r=(a=f<0)?(f=-f,c):(p=l,h)).reverse(),e=f;e--;r.push(0));r.reverse()}else for(o=((a=c.length0)for(;e--;c[o++]=0);for(e=h.length;e>f;){if(c[--e]0?(s=o,f):(i=-i,a)).reverse();i--;r.push(0));r.reverse()}for(a.length-f.length<0&&(r=f,f=a,a=r),i=f.length,e=0;i;e=(a[--i]=a[i]+f[i]+e)/10^0,a[i]%=10);for(e&&(a.unshift(e),++s>u&&(a=s=null)),i=a.length;0==a[--i];a.pop());return t.c=a,t.e=s,t},l.toPower=l.pow=function(t){var e=0*t==0?0|t:t,n=new g(this),i=new g(y);if(((r=t<-1e6||t>1e6)&&(e=1*t/0)||c(t)!=t&&0!==t&&!(e=NaN))&&!b(t,"exponent","pow")||!e)return new g(Math.pow(n.toS(),e));for(e=e<0?-e:e;1&e&&(i=i.times(n)),e>>=1;)n=n.times(n);return t<0?y.div(i):i},l.powm=function(t,e){return this.pow(t).mod(e)},l.round=function(t,e){return E(this,t=null==t||((r=t<0||t>1e9)||c(t)!=t)&&!b(t,"decimal places","round")?0:0|t,e=null==e||((r=e<0||e>8)||c(e)!=e&&0!==e)&&!b(e,"mode","round")?i:0|e)},l.squareRoot=l.sqrt=function(){var t,e,r,o,a=this,s=a.c,u=a.s,f=a.e,c=n,l=i,h=new g("0.5");if(1!==u||!s||!s[0])return new g(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);for(u=Math.sqrt(a.toS()),i=1,0==u||u==1/0?((t=s.join("")).length+f&1||(t+="0"),(e=new g(Math.sqrt(t)+"")).c||(e.c=[1]),e.e=((f+1)/2|0)-(f<0||1&f)):e=new g(t=u.toString()),(u=(r=e.e)+(n+=4))<3&&(u=0),f=u;;)if(o=e,e=h.times(o.plus(a.div(o))),o.c.slice(0,u).join("")===e.c.slice(0,u).join("")){if(9!=(s=e.c)[u-=t&&e.ef-2&&(s.length=f-2),e.times(e).eq(a)))){for(;s.length-1;a--){for(e=0,f=c+a;f>a;e=r[f]+o[a]*i[f-a-1]+e,r[f--]=e%10|0,e=e/10|0);e&&(r[f]=(r[f]+e)%10)}for(e&&++t.e,!r[0]&&r.shift(),f=r.length;!r[--f];r.pop());return t.c=t.e>u?t.e=null:t.e0&&c.copy(i,4+(128&c[0]?1:0)),128&c[0]&&(i[4]=0),i[0]=n&255<<24,i[1]=n&255<<16,i[2]=65280&n,i[3]=255&n;var o=this.lt(0);if(o)for(var a=4;a0}).forEach(function(t,e){for(var r=0;r1e9)||c(t)!=t&&0!==t)&&!b(t,"decimal places","toE"))&&this.c?this.c.length-1:0|t,1)},l.toFixed=l.toF=function(t){var e,n,i,s=this;return null==t||((r=t<0||t>1e9)||c(t)!=t&&0!==t)&&!b(t,"decimal places","toF")||(i=s.e+(0|t)),e=o,t=a,o=-(a=1/0),i==n?n=s.toS():(n=_(s,i),s.s<0&&s.c&&(s.c[0]?n.indexOf("-")<0&&(n="-"+n):n=n.replace(/^-/,""))),o=e,a=t,n},l.toFraction=l.toFr=function(t){var e,o,a,s,c,l,h,p=s=new g(y),v=a=new g("0"),m=this,w=m.c,_=u,A=n,E=i,x=new g(y);if(!w)return m.toS();for(h=x.e=w.length-m.e-1,(null==t||(!(d=12,l=new g(t)).s||(r=l.cmp(p)<0||!l.c)||f&&l.e0)&&(t=h>0?x:p),u=1/0,l=new g(w.join("")),n=0,i=1;e=l.div(x),1!=(c=s.plus(e.times(v))).cmp(t);)s=v,v=c,p=a.plus(e.times(c=p)),a=c,x=l.minus(e.times(c=x)),l=c;return c=t.minus(s).div(v),a=a.plus(c.times(p)),s=s.plus(c.times(v)),a.s=p.s=m.s,n=2*h,i=E,o=p.div(v).minus(m).abs().cmp(a.div(s).minus(m).abs())<1?[p.toS(),v.toS()]:[a.toS(),s.toS()],u=_,n=A,o},l.toPrecision=l.toP=function(t){return null==t||((r=t<1||t>1e9)||c(t)!=t)&&!b(t,"precision","toP")?this.toS():_(this,0|--t,2)},l.toString=l.toS=function(t){var e,n,i,s=this,u=s.e;if(null===u)n=s.s?"Infinity":"NaN";else{if(t===e&&(u<=o||u>=a))return _(s,s.c.length-1,1);if(n=s.c.join(""),u<0){for(;++u;n="0"+n);n="0."+n}else if(i=n.length,u>0)if(++u>i)for(u-=i;u--;n+="0");else u1)n=e+"."+n.slice(1);else if("0"==e)return e;if(null!=t)if((r=!(t>=2&&t<65))||t!=(0|t)&&f)b(t,"base","toS");else if("0"==(n=m(n,0|t,10,s.s)))return n}return s.s<0?"-"+n:n},l.valueOf=function(){return this.toS()},e.exports=g}).call(this,t("buffer").Buffer)},{buffer:4}],4:[function(t,e,r){"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|d(t,e),n=a(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return l(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(P(t,ArrayBuffer)||t&&P(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||P(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=arguments.length>2&&!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 L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(i)return n?-1:L(t).length;e=(""+e).toLowerCase(),i=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(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),H(r=+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=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){var o,a=1,s=t.length,u=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;a=2,s/=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var l=!0,h=0;hi&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+l<=r)switch(l){case 1:f<128&&(c=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&f)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,l=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=l}return function(t){var e=t.length;if(e<=B)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.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 C(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return U(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),""},s.prototype.compare=function(t,e,r,n,i){if(P(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),f=this.slice(n,i),c=t.slice(e,r),l=0;l>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return m(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var B=4096;function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function R(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 I(t,e,r,n,o){return e=+e,r>>>=0,o||R(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function j(t,e,r,n,o){return e=+e,r>>>=0,o||R(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(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},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(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},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(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},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.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),e||(e=0),n>0&&n=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),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},s.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&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+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 F(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(M,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function P(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function H(t){return t!=t}},{"base64-js":2,ieee754:31}],5:[function(t,e,r){!function(t,r){"use strict";var n=Math.pow(2,-24),i=Math.pow(2,32),o=Math.pow(2,53);var a={encode:function(t){var e,n=new ArrayBuffer(256),a=new DataView(n),s=0;function u(t){for(var r=n.byteLength,i=s+t;r>2,f=0;f>6),i.push(128|63&a)):a<55296?(i.push(224|a>>12),i.push(128|a>>6&63),i.push(128|63&a)):(a=(1023&a)<<10,a|=1023&e.charCodeAt(++n),a+=65536,i.push(240|a>>18),i.push(128|a>>12&63),i.push(128|a>>6&63),i.push(128|63&a))}return h(3,i.length),l(i);default:var d;if(Array.isArray(e))for(h(4,d=e.length),n=0;n>5!==t)throw"Invalid indefinite length element";return r}function y(t,e){for(var r=0;r>10),t.push(56320|1023&n))}}"function"!=typeof e&&(e=function(t){return t}),"function"!=typeof o&&(o=function(){return r});var g=function t(){var i,h,g=c(),b=g>>5,m=31&g;if(7===b)switch(m){case 25:return function(){var t=new ArrayBuffer(4),e=new DataView(t),r=l(),i=32768&r,o=31744&r,a=1023&r;if(31744===o)o=261120;else if(0!==o)o+=114688;else if(0!==a)return a*n;return e.setUint32(0,i<<16|o<<13|a<<13),e.getFloat32(0)}();case 26:return u(a.getFloat32(s),4);case 27:return u(a.getFloat64(s),8)}if((h=p(m))<0&&(b<2||6=0;)_+=h,w.push(f(h));var A=new Uint8Array(_),E=0;for(i=0;i=0;)y(x,h);else y(x,h);return String.fromCharCode.apply(null,x);case 4:var B;if(h<0)for(B=[];!d();)B.push(t());else for(B=new Array(h),i=0;i>8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],19:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[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];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("ccitt",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:65535,o=0;o>8^a)]^r<<8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],20:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[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];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("kermit",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:0,o=0;o>8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],21:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[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];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("crc-16-modbus",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:65535,o=0;o>8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],22:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=o(t("./create_buffer"));function o(t){return t&&t.__esModule?t:{default:t}}var a=(0,o(t("./define_crc")).default)("xmodem",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:0,o=0;o>>8&255;a^=255&t[o],r=r<<8&65535,r^=a^=a>>>4,r^=a=a<<5&65535,r^=a=a<<7&65535}return r});r.default=a},{"./create_buffer":28,"./define_crc":29,buffer:4}],23:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[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];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("crc-24",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:11994318,o=0;o>16^a)]^r<<8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],24:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[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];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("crc-32",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=0===e?0:-1^~~e,o=0;o>>8}return-1^r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],25:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[0,7,14,9,28,27,18,21,56,63,54,49,36,35,42,45,112,119,126,121,108,107,98,101,72,79,70,65,84,83,90,93,224,231,238,233,252,251,242,245,216,223,214,209,196,195,202,205,144,151,158,153,140,139,130,133,168,175,166,161,180,179,186,189,199,192,201,206,219,220,213,210,255,248,241,246,227,228,237,234,183,176,185,190,171,172,165,162,143,136,129,134,147,148,157,154,39,32,41,46,59,60,53,50,31,24,17,22,3,4,13,10,87,80,89,94,75,76,69,66,111,104,97,102,115,116,125,122,137,142,135,128,149,146,155,156,177,182,191,184,173,170,163,164,249,254,247,240,229,226,235,236,193,198,207,200,221,218,211,212,105,110,103,96,117,114,123,124,81,86,95,88,77,74,67,68,25,30,23,16,5,2,11,12,33,38,47,40,61,58,51,52,78,73,64,71,82,85,92,91,118,113,120,127,106,109,100,99,62,57,48,55,34,37,44,43,6,1,8,15,26,29,20,19,174,169,160,167,178,181,188,187,150,145,152,159,138,141,132,131,222,217,208,215,194,197,204,203,230,225,232,239,250,253,244,243];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("crc-8",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=~~e,o=0;o1&&void 0!==arguments[1]?arguments[1]:-1;n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=0===e?0:~~e,o=0;o>>8}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],28:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=n.Buffer.from&&n.Buffer.alloc&&n.Buffer.allocUnsafe&&n.Buffer.allocUnsafeSlow?n.Buffer.from:function(t){return new n.Buffer(t)};r.default=i},{buffer:4}],29:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t,e){var r=function(t,r){return e(t,r)>>>0};return r.signed=e,r.unsigned=r,r.model=t,r}},{}],30:[function(t,e,r){"use strict";e.exports={crc1:t("./crc1"),crc8:t("./crc8"),crc81wire:t("./crc8_1wire"),crc16:t("./crc16"),crc16ccitt:t("./crc16_ccitt"),crc16modbus:t("./crc16_modbus"),crc16xmodem:t("./crc16_xmodem"),crc16kermit:t("./crc16_kermit"),crc24:t("./crc24"),crc32:t("./crc32"),crcjam:t("./crcjam")}},{"./crc1":6,"./crc16":7,"./crc16_ccitt":8,"./crc16_kermit":9,"./crc16_modbus":10,"./crc16_xmodem":11,"./crc24":12,"./crc32":13,"./crc8":14,"./crc8_1wire":15,"./crcjam":16}],31:[function(t,e,r){r.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,c=-7,l=r?i-1:0,h=r?-1:1,d=t[e+l];for(l+=h,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+t[e+l],l+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+l],l+=h,c-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=f}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,f=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=c?(s=0,a=c):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=p,a/=256,f-=8);t[r+d-p]|=128*v}},{}],32:[function(t,e,r){"use strict";!function(t){function n(t,e,r){var n,i,o,d,p,v,y,g,b,m=0,w=[],_=0,A=!1,B=[],k=[],U=!1;if(n=(r=r||{}).encoding||"UTF8",(b=r.numRounds||1)!==parseInt(b,10)||1>b)throw Error("numRounds must a integer >= 1");if(0!==t.lastIndexOf("SHA-",0))throw Error("Chosen SHA variant is not supported");if(v=function(e,r){return x(e,r,t)},y=function(e,r,n,i){var o,a;if("SHA-224"!==t&&"SHA-256"!==t)throw Error("Unexpected error in SHA-2 implementation");for(o=15+(r+65>>>9<<4),a=16;e.length<=o;)e.push(0);for(e[r>>>5]|=128<<24-r%32,r+=n,e[o]=4294967295&r,e[o-1]=r/4294967296|0,n=e.length,r=0;r>>3)/4-1,a>>5;for(t=(e=o(t,w,_)).binLen,r=e.value,e=t>>>5,n=0;n>>5),_=t%p,U=!0},this.getHash=function(e,r){var n,o,h,p;if(!0===A)throw Error("Cannot call getHash after setting HMAC key");switch(h=l(r),e){case"HEX":n=function(t){return a(t,d,h)};break;case"B64":n=function(t){return s(t,d,h)};break;case"BYTES":n=function(t){return u(t,d)};break;case"ARRAYBUFFER":try{o=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}n=function(t){return f(t,d)};break;case"UINT8ARRAY":try{o=new Uint8Array(0)}catch(t){throw Error("UINT8ARRAY not supported by this environment")}n=function(t){return c(t,d)};break;default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}for(p=y(w.slice(),_,m,g(i)),o=1;o>>3,n=0;n>>2,e.length<=o&&e.push(0),e[o]|=t[n]<<8*(3+a%4*-1);return{value:e,binLen:8*t.length+r}}function a(t,e,r){var n,i,o="";for(e/=8,n=0;n>>2]>>>8*(3+n%4*-1),o+="0123456789abcdef".charAt(i>>>4&15)+"0123456789abcdef".charAt(15&i);return r.outputUpper?o.toUpperCase():o}function s(t,e,r){var n,i,o,a="",s=e/8;for(n=0;n>>2]:0,o=n+2>>2]:0,o=(t[n>>>2]>>>8*(3+n%4*-1)&255)<<16|(i>>>8*(3+(n+1)%4*-1)&255)<<8|o>>>8*(3+(n+2)%4*-1)&255,i=0;4>i;i+=1)a+=8*n+6*i<=e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-i)&63):r.b64Pad;return a}function u(t,e){var r,n,i="",o=e/8;for(r=0;r>>2]>>>8*(3+r%4*-1)&255,i+=String.fromCharCode(n);return i}function f(t,e){var r,n,i=e/8,o=new ArrayBuffer(i);for(n=new Uint8Array(o),r=0;r>>2]>>>8*(3+r%4*-1)&255;return o}function c(t,e){var r,n=e/8,i=new Uint8Array(n);for(r=0;r>>2]>>>8*(3+r%4*-1)&255;return i}function l(t){var e={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(t=t||{},e.outputUpper=t.outputUpper||!1,!0===t.hasOwnProperty("b64Pad")&&(e.b64Pad=t.b64Pad),"boolean"!=typeof e.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof e.b64Pad)throw Error("Invalid b64Pad formatting option");return e}function h(t,e){var r;switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(t){case"HEX":r=function(t,e,r){var n,i,o,a,s,u=t.length;if(0!=u%2)throw Error("String of HEX type must be in byte increments");for(e=e||[0],s=(r=r||0)>>>3,n=0;n>>1)+s)>>>2;e.length<=o;)e.push(0);e[o]|=i<<8*(3+a%4*-1)}return{value:e,binLen:4*u+r}};break;case"TEXT":r=function(t,r,n){var i,o,a,s,u,f,c,l,h=0;if(r=r||[0],u=(n=n||0)>>>3,"UTF8"===e)for(l=3,a=0;a(i=t.charCodeAt(a))?o.push(i):2048>i?(o.push(192|i>>>6),o.push(128|63&i)):55296>i||57344<=i?o.push(224|i>>>12,128|i>>>6&63,128|63&i):(a+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(a)),o.push(240|i>>>18,128|i>>>12&63,128|i>>>6&63,128|63&i)),s=0;s>>2;r.length<=f;)r.push(0);r[f]|=o[s]<<8*(l+c%4*-1),h+=1}else if("UTF16BE"===e||"UTF16LE"===e)for(l=2,o="UTF16LE"===e||"UTF16LE"!==e&&!1,a=0;a>>8),f=(c=h+u)>>>2;r.length<=f;)r.push(0);r[f]|=i<<8*(l+c%4*-1),h+=2}return{value:r,binLen:8*h+n}};break;case"B64":r=function(t,e,r){var n,i,o,a,s,u,f,c=0;if(-1===t.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(i=t.indexOf("="),t=t.replace(/\=/g,""),-1!==i&&i a.name.toUpperCase() > b.name.toUpperCase() ? 1 : -1) // .forEach(c => console.log(`"${c.name}","${c.symbol}",`)); - - diff --git a/src/monero_validator.js b/src/monero_validator.js index fd78064d..4edab3a9 100644 --- a/src/monero_validator.js +++ b/src/monero_validator.js @@ -21,8 +21,10 @@ function validateNetwork(decoded, currency, networkType, addressType) { return network.prod.indexOf(at) >= 0 case 'testnet': return network.testnet.indexOf(at) >= 0 + case 'stagenet': + return network.stagenet.indexOf(at) >= 0 case 'both': - return network.prod.indexOf(at) >= 0 || network.testnet.indexOf(at) >= 0 + return network.prod.indexOf(at) >= 0 || network.testnet.indexOf(at) >= 0 || network.stagenet.indexOf(at) >= 0 default: return false } diff --git a/src/siacoin_validator.js b/src/siacoin_validator.js index 5dc716a1..de67aa6d 100644 --- a/src/siacoin_validator.js +++ b/src/siacoin_validator.js @@ -1,5 +1,5 @@ var cryptoUtils = require('./crypto/utils') -var isEqual = require('lodash/isEqual') +var isEqual = require('lodash.isequal') function hexToBytes(hex) { var bytes = [] diff --git a/test/wallet_address_validator.js b/test/wallet_address_validator.js index 3580f512..ea9ec9ac 100644 --- a/test/wallet_address_validator.js +++ b/test/wallet_address_validator.js @@ -1,930 +1,1419 @@ var isNode = typeof module !== 'undefined' && typeof module.exports !== 'undefined' var chai = isNode ? require('chai') : window.chai, - expect = chai.expect + expect = chai.expect var WAValidator = isNode ? require('../src/wallet_address_validator') : window.WAValidator function valid(address, currency, networkType) { - var valid = WAValidator.validate(address, currency, networkType); - expect({ address, currency, valid }).to.deep.equal({ address, currency, valid: true }); + var valid = WAValidator.validate(address, currency, networkType); + expect({ address, currency, valid }).to.deep.equal({ address, currency, valid: true }); } function invalid(address, currency, networkType) { - var valid = WAValidator.validate(address, currency, networkType); - expect({ address, currency, valid }).to.deep.equal({ address, currency, valid: false }); + var valid = WAValidator.validate(address, currency, networkType); + expect({ address, currency, valid }).to.deep.equal({ address, currency, valid: false }); } describe('WAValidator.validate()', function () { - describe('valid results', function () { - it('should return true for correct bitcoin addresses', function () { - valid('12KYrjTdVGjFMtaxERSk3gphreJ5US8aUP', 'bitcoin'); - valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'bitcoin'); - valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'BTC'); - valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'Bitcoin'); - valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'btc'); - valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'btc', 'prod'); - valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'btc', 'both'); - valid('15uwigGExiNQxTNr1QSZYPXJMp9Px2YnVU', 'btc', 'prod'); - valid('3FyVFsEyyBPzHjD3qUEgX7Jsn4tcHNZFkn', 'btc', 'prod'); - valid('38mKdURe1zcQyrFqRLzR8PRao3iLGEPVsU', 'btc', 'prod'); - valid('mptPo5AvLzJXi4T82vR6g82fT5uJ6HsQCu', 'btc', 'both'); - valid('1oNLrsHnBcR6dpaBpwz3LSwutbUNkNSjs', 'bitcoin'); - valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'bitcoin', 'testnet'); - valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'bitcoin', 'both'); - - valid('1SQHtwR5oJRKLfiWQ2APsAd9miUc4k2ez'); - valid('116CGDLddrZhMrTwhCVJXtXQpxygTT1kHd'); - - // p2sh addresses - valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt'); - valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'bitcoin'); - valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'bitcoin', 'testnet'); - - // regtest - valid('GSa5espVLNseXEfKt46zEdS6jrPkmFghBU', 'bitcoin', 'testnet'); - - // segwit addresses - valid('BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4', 'bitcoin'); - valid('tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7', 'bitcoin'); - valid('bc1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k7grplx', 'bitcoin'); - valid('BC1SW50QA3JX3S', 'bitcoin'); - valid('bc1zw508d6qejxtdg4y5r3zarvaryvg6kdaj', 'bitcoin'); - valid('tb1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesrxh6hy', 'bitcoin'); - - invalid("tc1qw508d6qejxtdg4y5r3zarvary0c5xw7kg3g4ty", 'bitcoin'), - invalid("bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t5", 'bitcoin'), - invalid("BC13W508D6QEJXTDG4Y5R3ZARVARY0C5XW7KN40WF2", 'bitcoin'), - invalid("bc1rw5uspcuh", 'bitcoin'), - invalid("bc10w508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7kw5rljs90", 'bitcoin'), - invalid("BC1QR508D6QEJXTDG4Y5R3ZARVARYV98GJ9P", 'bitcoin'), - invalid("tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sL5k7", 'bitcoin'), - invalid("bc1zw508d6qejxtdg4y5r3zarvaryvqyzf3du", 'bitcoin'), - invalid("tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3pjxtptv", 'bitcoin'), - invalid("bc1gmk9yu", 'bitcoin') - }); - - it('should return true for correct bitcoincash addresses', function () { - valid('12KYrjTdVGjFMtaxERSk3gphreJ5US8aUP', 'bitcoincash'); - valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'bitcoincash'); - valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'BCH'); - valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'Bitcoin'); - valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'bch'); - valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'bch', 'prod'); - valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'bch', 'both'); - valid('1oNLrsHnBcR6dpaBpwz3LSwutbUNkNSjs', 'bitcoincash'); - valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'bitcoincash', 'testnet'); - valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'bitcoincash', 'both'); - - // p2sh addresses - valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'bitcoincash'); - valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'bitcoincash', 'testnet'); - - valid('bitcoincash:qq4v32mtagxac29my6gwj6fd4tmqg8rysu23dax807', 'bch'); - - }); - - it('should return true for correct litecoin addresses', function () { - valid('LVg2kJoFNg45Nbpy53h7Fe1wKyeXVRhMH9', 'litecoin'); - valid('LVg2kJoFNg45Nbpy53h7Fe1wKyeXVRhMH9', 'LTC'); - valid('LTpYZG19YmfvY2bBDYtCKpunVRw7nVgRHW', 'litecoin'); - valid('Lb6wDP2kHGyWC7vrZuZAgV7V4ECyDdH7a6', 'litecoin'); - valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'litecoin', 'testnet'); - - // p2sh addresses - valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'litecoin'); - valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'litecoin', 'testnet'); - valid('QW2SvwjaJU8LD6GSmtm1PHnBG2xPuxwZFy', 'litecoin', 'testnet'); - valid('QjpzxpbLp5pCGsCczMbfh1uhC3P89QZavY', 'litecoin', 'testnet'); - }); - - it('should return true for correct peercoin addresses', function () { - valid('PHCEsP6od3WJ8K2WKWEDBYKhH95pc9kiZN', 'peercoin'); - valid('PSbM1pGoE9dnAuVWvpQqTTYVpKZU41dNAz', 'peercoin'); - valid('PUULeHrJL2WujJkorc2RsUAR3SardKUauu', 'peercoin'); - valid('PUULeHrJL2WujJkorc2RsUAR3SardKUauu', 'PPC'); - valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'peercoin', 'testnet'); - - // p2sh addresses - valid('pNms4CaWqgZUxbNZaA1yP2gPr3BYnez9EM', 'peercoin'); - valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'peercoin', 'testnet'); - }); - - it('should return true for correct dogecoin addresses', function () { - valid('DPpJVPpvPNP6i6tMj4rTycAGh8wReTqaSU', 'dogecoin'); - valid('DNzLUN6MyYVS5zf4Xc2yK69V3dXs6Mxia5', 'dogecoin'); - valid('DPS6iZj7roHquvwRYXNBua9QtKPzigUUhM', 'dogecoin'); - valid('DPS6iZj7roHquvwRYXNBua9QtKPzigUUhM', 'DOGE'); - //TODO: NEED A DOGECOIN TESTNET ADDRESS - - //p2sh addresses - valid('A7JjzK9k9x5b2MkkQzqt91WZsuu7wTu6iS', 'dogecoin'); - valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'dogecoin', 'testnet'); - }); - - it('should return true for correct beavercoin addresses', function () { - valid('BPPtB4EpPi5wCaGXZuNyKQgng8ya579qUh', 'beavercoin'); - valid('BC1LLYoE4mTCHTJhVYvLGxhRTwAHyWTQ49', 'beavercoin'); - valid('BBuyeg2vjtyFdMNj3LTxuVra4wJMKVAY9C', 'beavercoin'); - valid('BBuyeg2vjtyFdMNj3LTxuVra4wJMKVAY9C', 'BVC'); - valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'beavercoin', 'testnet'); - - // p2sh addresses - valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'beavercoin'); - valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'beavercoin', 'testnet'); - }); - - it('should return true for correct freicoin addresses', function () { - valid('1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa', 'freicoin'); - valid('1oNLrsHnBcR6dpaBpwz3LSwutbUNkNSjs', 'freicoin'); - valid('1SQHtwR5oJRKLfiWQ2APsAd9miUc4k2ez', 'freicoin'); - valid('1SQHtwR5oJRKLfiWQ2APsAd9miUc4k2ez', 'FRC'); - valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'freicoin', 'testnet'); - - // p2sh addresse - valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'freicoin'); - valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'freicoin', 'testnet'); - }); - - it('should return true for correct protoshares addresses', function () { - valid('PaNGELmZgzRQCKeEKM6ifgTqNkC4ceiAWw', 'protoshares'); - valid('Piev8TMX2fT5mFtgxx2TXJaqXP37weMPuD', 'protoshares'); - valid('PgsuLoe9ojRKFGJGVpqqk37gAqNJ4ozboD', 'protoshares'); - valid('PgsuLoe9ojRKFGJGVpqqk37gAqNJ4ozboD', 'PTS'); - valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'protoshares', 'testnet'); - - //p2sh addresses - valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'protoshares'); - valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'protoshares', 'testnet'); - }); - - it('should return true for correct megacoin addresses', function () { - valid('MWUHaNxjXGZUYTh92i3zuDmsnH1rHSBk5M', 'megacoin'); - valid('MSAkrhRyte7bz999Ga5SqYjzypFFYa2oEb', 'megacoin'); - valid('MLUTAtDQFcfo1QACWocLuufFq5fBDTpCHE', 'megacoin'); - valid('MLUTAtDQFcfo1QACWocLuufFq5fBDTpCHE', 'MEC'); - valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'megacoin', 'testnet'); - - //p2sh addresses - valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'megacoin'); - valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'megacoin', 'testnet'); - }); - - it('should return true for correct primecoin addresses', function () { - valid('AVKeiZ5JadfWdH2EYVgVRfX4ufoyd4ehuM', 'primecoin'); - valid('AQXBRPyob4dywUJ21RUKrR1xetQCDVenKD', 'primecoin'); - valid('ANHfTZnskKqaBU7oZuSha9SpbHU3YBfeKf', 'primecoin'); - valid('AYdiYMKSGYxLcZNDmqB8jNcck7SQibrfiK', 'primecoin'); - valid('AYdiYMKSGYxLcZNDmqB8jNcck7SQibrfiK', 'XPM'); - valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'primecoin', 'testnet'); - - //p2sh addresses - valid('af5CvTQq7agDh717Wszb5QDbWb7nT2mukP', 'primecoin'); - valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'primecoin', 'testnet'); - }); - - it('should return true for correct auroracoin addresses', function () { - valid('ARM3GLZXF1PDTZ5vz3wh5MVahbK9BHTWAN', 'auroracoin'); - valid('AUtfc6ThCLb7FuEu7QPrWpJuaXaJRPciDF', 'auroracoin'); - valid('AUN1oaj5hjispGnczt8Aruw3TxgGyRqB3V', 'auroracoin'); - valid('AXGcBkGX6NiaDXj85C5dCrhTRUgwxSkKDK', 'auroracoin'); - valid('AXGcBkGX6NiaDXj85C5dCrhTRUgwxSkKDK', 'AUR'); - valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'auroracoin', 'testnet'); - - //p2sh addresses - valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'auroracoin'); - valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'auroracoin', 'testnet'); - }); - - it('should return true for correct namecoin addresses', function () { - valid('NEpeRmS775fnti8TDgJA28m8KLEfNNRZvT', 'namecoin'); - valid('MyJ691bGJ48RBK2LS8n1U57wcFLFScFXxi', 'namecoin'); - valid('NFY9aw1RXLGtWpeqgNQXprnUcZXyKNinTh', 'namecoin'); - valid('NCPPc7Pzb75CpRPJQPRRh6ouJTq7BCy1H4', 'namecoin'); - valid('NCPPc7Pzb75CpRPJQPRRh6ouJTq7BCy1H4', 'NMC'); - }); - - it('should return true for correct BioCoin addresses', function () { - valid('B7xseoLGk7hEpMDDeSvZDKmmiAMHWiccok', 'biocoin'); - valid('B8zjmYFGhWmiaQSJshfrnefE72xCapCkvo', 'biocoin'); - valid('muH8LL42DiMs8GEQ6Grfi8KUw2uFvuKr1J', 'biocoin', 'testnet'); - valid('muH8LL42DiMs8GEQ6Grfi8KUw2uFvuKr1J', 'BIO', 'testnet'); - valid('B8zjmYFGhWmiaQSJshfrnefE72xCapCkvo', 'BIO'); - }); - - it('should return true for correct Garlicoin addresses', function () { - valid('GU2NtcNotWFiZjTp2Vdgf5CjeMfgsWYCua', 'garlicoin'); - valid('GNWeWaoQ6rv21ZFjJWT9vb91hXUzFTLkru', 'garlicoin'); - valid('mjKbQTkgwzmsL3J86tdVzhyW9pc4NePqTb', 'garlicoin', 'testnet'); - valid('mnYp36NuyRavMKQ9Q9Q6oGqoorAs9p3zYn', 'GRLC', 'testnet'); - valid('GU2NtcNotWFiZjTp2Vdgf5CjeMfgsWYCua', 'GRLC'); - }); - - it('should return true for correct Vertcoin addresses', function () { - valid('3PgeyhEJEnS5CeBu3iFcu3JHVKemeHx1AW', 'VTC'); - valid('353nERPQKhGj4WGzoiWcareA76TPgRCVNA', 'VTC'); - valid('376g4TmL8uQKFYsRFrbv5iz9srmb5bocEt', 'VTC'); - valid('3AMtM4Zk5oNHu9i4jDiwKB6Kg5YEReBsav', 'VTC'); - - valid('VmoMjGf3zgZLy8sk3PMKd3xikZHXWvnYi7', 'vertcoin'); - valid('VmhHwXr3J8xMZpy62WuBGpu3xVvThWzcTQ', 'vertcoin'); - valid('mvww6DEJ18dbyQUukpVQXvLgrNDJazZn1Y', 'vertcoin', 'testnet'); - valid('mn3mdEE6cf1snxVsknNz4GRTdSrWXqYp7c', 'VTC', 'testnet'); - valid('Vri6Q4GgNFfdtcpxD961TotJwaSaYQCaL5', 'VTC'); - }); - - it('should return true for correct BitcoinGold addresses', function () { - valid('GW3JrQyHtoVfEFES3Y9JagiX3VSKQStLwj', 'bitcoingold'); - valid('GUDWdeMyAXQbrNFFivAhkJQ1GfBCFdc7JF', 'bitcoingold'); - valid('mvww6DEJ18dbyQUukpVQXvLgrNDJazZn1Y', 'bitcoingold', 'testnet'); - valid('mn3mdEE6cf1snxVsknNz4GRTdSrWXqYp7c', 'BTG', 'testnet'); - valid('GSNFPRsdaM3MXrU5HW1AxgFwmUQC8HXK9F', 'BTG'); - }); - - it('should return true for correct Decred addresses', function () { - valid('Dsesax2GJnMN4wwmWo5rJGq73dDK217Rh85', 'DCR'); - valid('DsYuxtvGRfN8rncXAndtLUpJm55F77K17RA', 'decred'); - valid('DsaXDG2NrJW8g4tFAb8n9MNx81Sn3Qc8AEV', 'decred'); - valid('TsijUgejaRnLKF5WAbpUxNtwKGUiKVeXLr7', 'decred', 'testnet'); - valid('TsZ9QmAoadF12hGvyALp6qvaF4be3BmLqG9', 'dcr', 'testnet'); - }); - - it('should return true for correct Digibyte addresses', function () { - valid('DG2rM2orU2JH5i4ACh3AKNpRTNESdv5xf8', 'DGB'); - valid('DBR2Lj1F17eHGHXgbpae2Wb4m39bDyA1qo', 'DGB'); - valid('D9TDZTR9Z9Mx2NoDJnhqhnYhDLKRAmsL9n', 'digibyte'); - valid('DHRzA1YHA1kFWpz2apRckZJy6KZRyGq4EV', 'digibyte'); - valid('DJ53hTyLBdZp2wMi5BsCS3rtEL1ioYUkva', 'digibyte'); - }); - - it('should return true for correct Ethereum addresses', function () { - valid('0xE37c0D48d68da5c5b14E5c1a9f1CFE802776D9FF', 'ethereum'); - valid('0xa00354276d2fC74ee91e37D085d35748613f4748', 'ethereum'); - valid('0xAff4d6793F584a473348EbA058deb8caad77a288', 'ETH'); - valid('0xc6d9d2cd449a754c494264e1809c50e34d64562b', 'ETH'); - valid('0x52908400098527886E0F7030069857D2E4169EE7', 'ETH'); - valid('0x8617E340B3D01FA5F11F306F4090FD50E238070D', 'ETH'); - valid('0xde709f2102306220921060314715629080e2fb77', 'ETH'); - valid('0x27b1fdb04752bbc536007a920d24acb045561c26', 'ETH'); - valid('0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed', 'ETH'); - valid('0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359', 'ETH'); - valid('0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB', 'ETH'); - valid('0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', 'ETH'); - - valid('0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', 'ethereumclassic'); - valid('0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', 'ETC'); - valid('0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', 'etherzero'); - valid('0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', 'ETZ'); - valid('0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', 'callisto'); - valid('0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', 'CLO'); - }); - - it('should return true for correct Ripple addresses', function () { - valid('rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn', 'ripple'); - valid('rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn', 'XRP'); - valid('r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV', 'XRP'); - valid('rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', 'XRP'); - valid('rDTXLQ7ZKZVKz33zJbHjgVShjsBnqMBhmN', 'XRP'); - }); - - it('should return true for correct dash addresses', function () { - valid('Xx4dYKgz3Zcv6kheaqog3fynaKWjbahb6b', 'dash'); - valid('XcY4WJ6Z2Q8w7vcYER1JypC8s2oa3SQ1b1', 'DASH'); - valid('XqMkVUZnqe3w4xvgdZRtZoe7gMitDudGs4', 'dash'); - valid('yPv7h2i8v3dJjfSH4L3x91JSJszjdbsJJA', 'dash', 'testnet'); - valid('XoAAqv3oUYZ6xRjX3brfbf9PotrGanS6Th', 'dash'); - valid('yP5oXZQXBfBf9FyfZDpFiKDypxuNUKUV2E', 'dash', 'testnet'); - }); - - it('should return true for correct neo addresses', function () { - valid('AR4QmqYENiZAD6oXe7ftm6eDcwtHk7rVTT', 'neo'); - valid('AKDVzYGLczmykdtRaejgvWeZrvdkVEvQ1X', 'NEO'); - }); - - it('should return true for correct neo gas addresses', function () { - valid('AR4QmqYENiZAD6oXe7ftm6eDcwtHk7rVTT', 'neogas'); - }); - - it('should return true for correct qtum addresses', function () { - valid('QNjUiD3bVVZwYTc5AhpeQbS1mfb2guyWhe', 'qtum'); - valid('QVZnSrMwKp6AL4FjUPPnfFgsma6j1DXQXu', 'QTUM'); - valid('MCgyroQse81wuv5RwPpY5DXDNxeafzLFJ8', 'QTUM'); - valid('QQYySVc5WEe3g6PnNFYmspqG5CfSG8rnma', 'QTUM'); - valid('MSvJQBJMZs1dhxz7UAWa2si4iyMD2FHQd5', 'QTUM'); - - valid('qcSLSxN1sngCWSrKFZ6UC7ri4hhVSdq9SU', 'qtum', 'testnet'); - valid('qJnbEdrm9ybjVqDCaX5SWNBHmZy2X7YbPT', 'qtum', 'testnet'); - valid('qchBPDUYswobzpDmY5DsTStt74sTYQtaQv', 'qtum', 'testnet'); - }); - - it('should return true for correct votecoin addresses', function () { - valid('t1U9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'votecoin'); - valid('t3Vz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'VOT'); - valid('t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'votecoin', 'testnet'); - }); - - it('should return true for correct bitcoinz addresses', function () { - valid('t1U9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'bitcoinz'); - valid('t3Vz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'BTCZ'); - valid('t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'bitcoinz', 'testnet'); - }); - - it('should return true for correct zclassic addresses', function () { - valid('t1U9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'zclassic'); - valid('t3Vz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'ZCL'); - valid('t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'zclassic', 'testnet'); - }); - - it('should return true for correct hush addresses', function () { - valid('t1U9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'hush'); - valid('t3Vz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'HUSH'); - valid('t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'hush', 'testnet'); - }); - - it('should return true for correct zcash addresses', function () { - valid('t1U9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'zcash'); - valid('t3Vz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'ZEC'); - valid('t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'zcash', 'testnet'); - }); - - it('should return true for correct bitcoinprivate addresses', function () { - valid('b1M4XXPFhwMb1SP33yhzn3h9qWXjujkgep4', 'bitcoinprivate'); - //valid('bx....', 'BTCP'); - //valid('nx....', 'bitcoinprivate', 'testnet'); - }); - - it('should return true for correct snowgem addresses', function () { - valid('s1fx7WBkjB4UH6qQjPp6Ysmtr1C1JiTK2Yw', 'snowgem'); - valid('s3d27MhkBRt3ha2UuxhjXaYF4DCnttTMnL1', 'SNG'); - valid('t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'snowgem', 'testnet'); - }); - - it('should return true for correct zencash addresses', function () { - valid('znhiGGfYRepxkBjXYvA2kFrXiC351i9ta4z', 'zencash'); - valid('zssEdGnZCQ9G86LZFtbynMn1hYTVhn6eYCL', 'ZEN'); - valid('ztmWMDLWjbruCJxKmmfAZiT6QAQdiv5F291', 'zencash', 'testnet'); - }); - - it('should return true for correct komodo addresses', function () { - valid('R9R5HirAzqDcWrWGiJEL115dpV3QB3hobH', 'komodo'); - valid('RAvj2KKVUohTu3hVdNJ4U6hQi7TNawpacH', 'KMD'); - //valid('t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'komodo', 'testnet'); - }); - - it('should return true for correct Bankex addresses', function () { - valid('0xeac39e1bc802baae3d4b9cb518f3f60374bbad6c', 'bankex'); - valid('0x45245bc59219eeaaf6cd3f382e078a461ff9de7b', 'BKX'); - valid('0xf40d80FCfa5cdEa0bB1E570c2D52132ac9bC6aEC', 'bankex', 'testnet'); - valid('0x8A7395f281EeCf2B471B689E87Cf4C7fa8bb957d', 'BKX', 'testnet'); - }); - - - it('should return true for correct Cardano addresses', function () { - valid('Ae2tdPwUPEYxYNJw1He1esdZYvjmr4NtPzUsGTiqL9zd8ohjZYQcwu6kom7', 'cardano'); - valid('DdzFFzCqrhsfdzUZxvuBkhV8Lpm9p43p9ubh79GCTkxJikAjKh51qhtCFMqUniC5tv5ZExyvSmAte2Du2tGimavSo6qSgXbjiy8qZRTg', 'ada'); - valid('Ae2tdPwUPEZKmwoy3AU3cXb5Chnasj6mvVNxV1H11997q3VW5ihbSfQwGpm', 'ada'); - valid('4swhHtxKapQbj3TZEipgtp7NQzcRWDYqCxXYoPQWjGyHmhxS1w1TjUEszCQT1sQucGwmPQMYdv1FYs3d51KgoubviPBf', 'cardano'); - }); - - it('should return true for correct monero addresses', function () { - valid('47zQ5LAivg6hNCgijXSEFVLX7mke1bgM6YGLFaANDoJbgXDymcAAZvvMNt2PmMpqEe5qRy2zyfMYXdwpmdyitiFh84xnPG2', 'monero'); - valid('48bWuoDG75CXMDHbmPEvUF2hm1vLDic7ZJ7hqRkL65QR9p13AQAX4eEACXNk4YP115Q4KRVZnAvmMBHrcGfv9FvKPZnH6vH', 'XMR'); - valid('A2be3UvzMtkJtxRYgcCbQt2y7Rp2eLVGqNTWfZeankrWimSMM4y7uMP6B9oAZaHsXTj8KFSerkSkkVRuEuEca9QM8VhxCNU', 'monero', 'testnet'); - - //integrated addresses - valid('4Gd4DLiXzBmbVX2FZZ3Cvu6fUaWACup1qDowprUCje1kSP4FmbftiJMSfV8kWZXNqmVwj4m52xqtgFNUudVmsmGkGvkLcCibWfVUfUFVB7', 'monero'); - valid('4J5sF94AzXgFgx8LuWc9dcWkJkGkD3cL3L2AuhX6QA9jFvSxxj6QhHqHXqM2b2Go7G8RyDzEbHxYd9G26XUUbuJChipEyBz9fENMU2Ua9b', 'XMR'); - }); - - it('should return true for correct gamecredits addresses', function () { - valid('GU5BBtW9gxSKvAknvFi9yUaXKUNW9zUN2p', 'game'); - valid('GYxQMVzP6YpzX59QNRYqmJeHNtUMYSZPri', 'game'); - }); - - it('should return true for correct monacoin addresses', function () { - valid('MMN1Q1aRVUzanmg9DJjcRYzQSJQoBeQPui', 'mona'); - valid('PFMzNYnBm5X4c9qJkJPkfgdCyd9fuuy2vT', 'mona'); - valid('PCtN7VUYHW8w4g59BaphrfPs8g7pNgAzxn', 'mona'); - valid('MXCcYFGRmsd4d3CcQugFiqG8uarj5tVu76', 'mona'); - valid('MNK1pGsBf9WdoE54fZM9VFhkeYHW6VUf2u', 'mona'); - }); - - it('should return true for correct pivx addresses', function () { - valid('DJXFW9oJJBUX7QKrG6GKvmTs63MYKzwtpZ', 'pivx'); - valid('DEaYb8EHQgyKvX6VXDS3DZQautJrHBmK3T', 'pivx'); - valid('DDeCGR3QSgqsBxVR23bJvteiyYE34ZmxAc', 'pivx'); - valid('DSqQM8DPpBHHoZXHgRdwmaf6hZPEoZcFkh', 'pivx'); - }); - - it('should return true for correct solarcoin addresses', function () { - valid('8VxVLzwB26E2YZZ82o1NcQe96QSM2z6GwW', 'slr'); - valid('8YW5qcTjeyqX5kESsqu2BUdXiedgssegtQ', 'SolarCoin'); - }); - - it('should return true for correct tether addresses', function () { - valid('3MbYQMMmSkC3AgWkj9FMo5LsPTW1zBTwXL', 'usdt'); - valid('1KdXaqcBeoMAFVAPwTmYvDbEq6RnvNPF6J', 'tether'); - }); - - it('should return true for correct expanse addresses', function () { - valid('0xbab463743603a253bdf1f84975b1a9517505ae05', 'exp'); - valid('0x5d0777cb5d6977873904864c6ab531f4b3261f0b', 'expanse'); - }); - - it('should return true for correct waves addresses', function () { - valid('3P93mVrYnQ4ahaRMYwA2BeWY32eDxTpLVEs', 'waves'); - valid('3P4eeU7v1LMHQFwwT2GW9W99c6vZyytHajj', 'waves'); - - valid('3Myrq5QDgRq3nBVRSSv9UYrP36xTtpJND5y', 'waves', 'testnet'); - valid('3My3KZgFQ3CrVHgz6vGRt8687sH4oAA1qp8', 'waves', 'testnet'); - }); - - it('should return true for correct nano addresses', function () { - valid('xrb_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3', 'nano'); - valid('xrb_13ezf4od79h1tgj9aiu4djzcmmguendtjfuhwfukhuucboua8cpoihmh8byo', 'nano'); - valid('xrb_35jjmmmh81kydepzeuf9oec8hzkay7msr6yxagzxpcht7thwa5bus5tomgz9', 'nano'); - valid('xrb_1111111111111111111111111111111111111111111111111111hifc8npp', 'nano'); - valid('xrb_1ipx847tk8o46pwxt5qjdbncjqcbwcc1rrmqnkztrfjy5k7z4imsrata9est', 'nano'); - valid('xrb_3wm37qz19zhei7nzscjcopbrbnnachs4p1gnwo5oroi3qonw6inwgoeuufdp', 'nano'); - valid('xrb_3arg3asgtigae3xckabaaewkx3bzsh7nwz7jkmjos79ihyaxwphhm6qgjps4', 'nano'); - valid('xrb_1f5e4w33ndqbkx4bw5jtp13kp5xghebfxcmw9hdt1f7goid1s4373w6tjmgu', 'nano'); - valid('xrb_1q79ahdr36uqn38p5tp5sqwkn73rnpj1k8obtuetdbjcx37d5gahhd1u9cuh', 'nano'); - valid('nano_1q79ahdr36uqn38p5tp5sqwkn73rnpj1k8obtuetdbjcx37d5gahhd1u9cuh', 'nano'); - }); - - it('should return true for correct siacoin addresses', function () { - valid( - 'a9b01c85163638682b170d82de02b8bb99ba86092e9ab1b0d25111284fe618e93456915820f1', - 'siacoin' - ) - valid( - 'a9b01c85163638682b170d82de02b8bb99ba86092e9ab1b0d25111284fe618e93456915820f1', - 'siacoin' - ) - valid( - 'ab0c327982abfcc6055a6c9551589167d8a73501aca8769f106371fbc937ad100c955c3b7ba9', - 'siacoin' - ) - valid( - 'ffe1308c044ade30392a0cdc1fd5a4dbe94f9616a95faf888ed36123d9e711557aa497530373', - 'siacoin' - ) - }) - - it('should return true for correct loki addresses', function () { - // public - valid( - 'L63ymg8cb5aRz1PhXrEQ22PWw9KBhBS8rMsgqbABhTGFfh53U3Rc2iWCJpCPsHZT5hfyt7fPQa612a5Z1tBnGYEA9h6YHnn', - 'loki' - ) - valid( - 'L5QKRGMNpQU3eCAdjMVTCR631bRKqnW1oEWWBEHAtFJLieA5VvuxyyubCd9FczEEatg8jfy39UJZ13npLJqZG6dtMtM99ha', - 'loki' - ) - // integrated - valid( - 'LK8CGQ17G9R3ys3Xf33wCeViD2B95jgdpjAhcRsjuheJ784dumXn7g3RPAzedWpFq364jJKYL9dkQ8mY66sZG9BiD1xbPb6dpYo7toNRqk', - 'loki' - ) - valid( - 'LK8CGQ17G9R3ys3Xf33wCeViD2B95jgdpjAhcRsjuheJ784dumXn7g3RPAzedWpFq364jJKYL9dkQ8mY66sZG9BiCtWq1AYo1oJTVqgUcQ', - 'loki' - ) - // subaddress - valid( - 'LW1VMYcvWPZZJ2h1pKGEku2y9WeDiAU2VhgrgVgvjybaRuCdcEkg6FhXjVNSd37Bp7fhYH8tVa5T9VmRaYiWyxYdCpEGBg8', - 'loki' - ) - }) - - it('should return true for correct lbry addresses', function () { - valid('bDb6NmobyDVeNGpizWQQBZkYjKCRQBdKdG', 'LBC') - valid('bTFXPcV3a8iVDezogvHTHezWZ1mZGWpPDc', 'lbc') - valid('bK2uEVn6UuwjCTUZ1Dfj5HhWYi9BtqZDDm', 'lbc') - valid('bNEMVqeUZUqTrYUxud5ehnUhtTAiWDXQ5e', 'lbc') - }) - - it('should return true for correct trx addresses', function () { - valid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r', 'trx'); - valid('27bLJCYjbH6MT8DBF9xcrK6yZnm43vx7MNQ', 'trx', 'testnet'); - }); - - it('should return true for correct nem addresses', function () { - valid('NBZMQO7ZPBYNBDUR7F75MAKA2S3DHDCIFG775N3D', 'xem'); - valid('TDWTRGT6GVWCV7GRWFNI45S53PGOJBKNUF3GE6PB', 'xem', 'testnet'); - }); - - it('should return true for correct lsk addresses', function () { - valid('469226551L', 'lsk'); - valid('15823701926930889868L', 'lsk'); - valid('1657699692452120239L', 'lsk'); - valid('555666666999992L', 'lsk'); - valid('6853061742992593192L', 'lsk'); - valid('530464791801L', 'lsk'); - }); - - it('should return true for correct bsv addresses', function () { - valid('qzwryn9fxnpqkf7zt878tp2g9cg8kpl65qh2ml0w0r', 'bsv'); - valid('qp65yngy5uds4wxtrkynptal4f76qzmrh52pa3mpaf', 'bsv'); - valid('bitcoincash:qq4v32mtagxac29my6gwj6fd4tmqg8rysu23dax807', 'bsv'); - valid('qq4v32mtagxac29my6gwj6fd4tmqg8rysu23dax807', 'bsv'); - valid('qz97s7ee0rvwlymtxrwafmvs87x6027jwuf3wepug7', 'bsv'); - valid('bitcoincash:qpp32ssez340wfspnt79h6c4xds4fzf3m5j0cplx0l', 'bsv'); - valid('qqg82u7tq2eahs3gkh9m6kjnmjehr69m5v37alepq4', 'bsv'); - valid('bitcoincash:qrwkk9a3es2wu7mdvzh0vekfvjuzysq8tv7r3hcwr5', 'bsv'); - valid('1DrNXqCj2B8FKyx66RAWDkiEJhw2yrvhT3', 'bsv'); - }); - - it('should return true for correct stellar addresses', function () { - valid('GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', 'stellar'); - valid('GB7KKHHVYLDIZEKYJPAJUOTBE5E3NJAXPSDZK7O6O44WR3EBRO5HRPVT', 'stellar'); - valid('GD6WVYRVID442Y4JVWFWKWCZKB45UGHJAABBJRS22TUSTWGJYXIUR7N2', 'stellar'); - valid('GBCG42WTVWPO4Q6OZCYI3D6ZSTFSJIXIS6INCIUF23L6VN3ADE4337AP', 'stellar'); - valid('GDFX463YPLCO2EY7NGFMI7SXWWDQAMASGYZXCG2LATOF3PP5NQIUKBPT', 'stellar'); - valid('GBXEODUMM3SJ3QSX2VYUWFU3NRP7BQRC2ERWS7E2LZXDJXL2N66ZQ5PT', 'stellar'); - valid('GAJHORKJKDDEPYCD6URDFODV7CVLJ5AAOJKR6PG2VQOLWFQOF3X7XLOG', 'stellar'); - valid('GACXQEAXYBEZLBMQ2XETOBRO4P66FZAJENDHOQRYPUIXZIIXLKMZEXBJ', 'stellar'); - valid('GDD3XRXU3G4DXHVRUDH7LJM4CD4PDZTVP4QHOO4Q6DELKXUATR657OZV', 'stellar'); - valid('GDTYVCTAUQVPKEDZIBWEJGKBQHB4UGGXI2SXXUEW7LXMD4B7MK37CWLJ', 'stellar'); - }); - - it('should return true for correct xtz(tezos) address', function () { - valid('tz1Lhf4J9Qxoe3DZ2nfe8FGDnvVj7oKjnMY6', 'xtz'); - valid('tz1PyxsQ7xVTa5J7gtBeT7pST5Zi5nk5GSjg', 'xtz'); - valid('tz1LcuQHNVQEWP2fZjk1QYZGNrfLDwrT3SyZ', 'xtz'); - valid('tz1Lhf4J9Qxoe3DZ2nfe8FGDnvVj7oKjnMY6', 'xtz'); - valid('tz1RR6wETy9BeXG3Fjk25YmkSMGHxTtKkhpX', 'xtz'); - valid('tz1h3rQ8wBxFd8L9B3d7Jhaawu6Z568XU3xY', 'xtz'); - valid('KT1EM2LvxxFGB3Svh9p9HCP2jEEYyHjABMbK', 'xtz'); - }); - - it('should return true for correct eos addresses', function () { - valid('bittrexacct1', 'eos'); - valid('binancecleos', 'eos'); - valid('123456789012', 'eos'); - }); - }); - - describe('invalid results', function () { - function commonTests(currency) { - invalid('', currency); //reject blank - invalid('%%@', currency); //reject invalid base58 string - invalid('1A1zP1ePQGefi2DMPTifTL5SLmv7DivfNa', currency); //reject invalid address - invalid('bd839e4f6fadb293ba580df5dea7814399989983', currency); //reject transaction id's - //testnet - invalid('', currency, 'testnet'); //reject blank - invalid('%%@', currency, 'testnet'); //reject invalid base58 string - invalid('1A1zP1ePQGefi2DMPTifTL5SLmv7DivfNa', currency, 'testnet'); //reject invalid address - invalid('bd839e4f6fadb293ba580df5dea7814399989983', currency, 'testnet'); //reject transaction id's - } - - it('should return false for incorrect bitcoin addresses', function () { - commonTests('bitcoin'); - }); - - it('should return false for incorrect bitcoincash addresses', function () { - commonTests('bitcoincash'); - }); - - it('should return false for incorrect litecoin addresses', function () { - commonTests('litecoin'); - }); - - it('should return false for incorrect peercoin addresses', function () { - commonTests('peercoin'); - }); - - it('should return false for incorrect dogecoin addresses', function () { - commonTests('dogecoin'); - }); - - it('should return false for incorrect beavercoin addresses', function () { - commonTests('beavercoin'); - }); - - it('should return false for incorrect freicoin addresses', function () { - commonTests('freicoin'); - }); - - it('should return false for incorrect protoshares addresses', function () { - commonTests('protoshares'); - }); - - it('should return false for incorrect megacoin addresses', function () { - commonTests('megacoin'); - }); - - it('should return false for incorrect primecoin addresses', function () { - commonTests('primecoin'); - }); - - it('should return false for incorrect auroracoin addresses', function () { - commonTests('auroracoin'); - }); - - it('should return false for incorrect namecoin addresses', function () { - commonTests('namecoin'); - }); - - it('should return false for incorrect biocoin addresses', function () { - commonTests('biocoin'); - }); - - it('should return false for incorrect garlicoin addresses', function () { - commonTests('garlicoin'); - }); - - it('should return false for incorrect vertcoin addresses', function () { - commonTests('vertcoin'); - }); - - it('should return false for incorrect bitcoingold addresses', function () { - commonTests('bitcoingold'); - }); - - it('should return false for incorrect decred addresses', function () { - commonTests('decred'); - }); - - it('should return false for incorrect gamecredits addresses', function () { - commonTests('game'); - }); - - it('should return false for incorrect monacoin addresses', function () { - commonTests('mona'); - }); - - it('should return false for incorrect solarcoin addresses', function () { - commonTests('slr'); - }); - - it('should return false for incorrect tether addresses', function () { - commonTests('usdt'); - }); - - it('should return false for incorrect expanse addresses', function () { - commonTests('exp'); - }); - - it('should return false for incorrect usdt addresses', function () { - commonTests('usdt'); - }); - - it('should return false for incorrect bankex addresses', function () { - invalid('1SQHtwR5oJRKLfiWQ2APsAd9miUc4k2ez', 'bankex'); - invalid('116CGDLddrZhMrTwhCVJXtXQpxygTT1kHd', 'BKX'); - invalid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'bankex', 'testnet'); - invalid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'BKX', 'testnet'); - }); - - it('should return false for incorrect digibyte addresses', function () { - commonTests('digibyte'); - }); - - it('should return false for incorrect eip55 addresses', function () { - invalid('6xAff4d6793F584a473348EbA058deb8caad77a288', 'ethereum'); - invalid('0x02fcd51aAbB814FfFe17908fbc888A8975D839A5', 'ethereum'); - invalid('0XD1220A0CF47C7B9BE7A2E6BA89F429762E7B9ADB', 'ethereum'); - invalid('aFf4d6793f584a473348ebA058deb8caad77a2885', 'ethereum'); - invalid('0xff4d6793F584a473', 'ethereum'); - - invalid('0x02fcd51aAbB814FfFe17908fbc888A8975D839A5', 'ethereumclassic'); - invalid('0x02fcd51aAbB814FfFe17908fbc888A8975D839A5', 'etherzero'); - invalid('0x02fcd51aAbB814FfFe17908fbc888A8975D839A5', 'callisto'); - }); - - it('should return false for incorrect ripple addresses', function () { - invalid('rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCN', 'ripple'); - invalid('rDTXLQ7ZKZVKz33zJbHjgVShjsBnqMBhMN', 'XRP'); - invalid('6xAff4d6793F584a473348EbA058deb8ca', 'ripple'); - invalid('DJ53hTyLBdZp2wMi5BsCS3rtEL1ioYUkva', 'ripple'); - }); - - it('should return false for incorrect dash addresses', function () { - commonTests('dash'); - }); - - it('should return false for incorrect neo addresses', function () { - commonTests('neo'); - invalid('AR4QmqYENiZAD6oXe7ftm6eDcwtHk7rVTa', 'neo'); - invalid('AKDVzYGLczmykdtRaejgvWeZrvdkVEvQ10', 'NEO'); - }); - - it('should return false for incorrect qtum addresses', function () { - commonTests('qtum'); - invalid('QNPhBbVhDghASxcUh2vHotQUgNeLRFTcfb', 'qtum'); - invalid('QOPhBbVhDghASxcUh2vHotQUgNeLRFTcfa', 'QTUM'); - }); - - it('should return false for incorrect votecoin addresses', function () { - commonTests('votecoin'); - invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'votecoin'); - invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'VOT'); - invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'votecoin', 'testnet'); - }); - - it('should return false for incorrect bitcoinz addresses', function () { - commonTests('bitcoinz'); - invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'bitcoinz'); - invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'BTCZ'); - invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'bitcoinz', 'testnet'); - }); - - it('should return false for incorrect zclassic addresses', function () { - commonTests('zclassic'); - invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'zclassic'); - invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'ZCL'); - invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'zclassic', 'testnet'); - }); - - it('should return false for incorrect hush addresses', function () { - invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'hush'); - invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'HUSH'); - invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'hush', 'testnet'); - }); - - it('should return false for incorrect zcash addresses', function () { - commonTests('zcash'); - invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'zcash'); - invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'ZEC'); - invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'zcash', 'testnet'); - }); - - it('should return false for incorrect bitcoinprivate addresses', function () { - commonTests('bitcoinprivate'); - invalid('b1Y4XXPFhwMb1SP33yhzn3h9qWXjujkgep4', 'bitcoinprivate'); - //invalid('bx....', 'BTCP'); - //invalid('nx....', 'bitcoinprivate', 'testnet'); - }); - - it('should return false for incorrect snowgem addresses', function () { - commonTests('snowgem'); - invalid('s1Yx7WBkjB4UH6qQjPp6Ysmtr1C1JiTK2Yw', 'snowgem'); - invalid('s3Y27MhkBRt3ha2UuxhjXaYF4DCnttTMnL1', 'SNG'); - invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'snowgem', 'testnet'); - }); - - it('should return false for incorrect zencash addresses', function () { - commonTests('zencash'); - invalid('znYiGGfYRepxkBjXYvA2kFrXiC351i9ta4z', 'zencash'); - invalid('zsYEdGnZCQ9G86LZFtbynMn1hYTVhn6eYCL', 'ZEN'); - invalid('ztYWMDLWjbruCJxKmmfAZiT6QAQdiv5F291', 'zencash', 'testnet'); - }); - - it('should return false for incorrect komodo addresses', function () { - commonTests('komodo'); - invalid('R9Y5HirAzqDcWrWGiJEL115dpV3QB3hobH', 'komodo'); - invalid('RAYj2KKVUohTu3hVdNJ4U6hQi7TNawpacH', 'KMD'); - //invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'komodo', 'testnet'); - }); - - it('should return false for incorrect cardano addresses', function () { - commonTests('cardano'); - invalid('Ae2tdPwUPEYxYNJw1He1esdZYvjmr4NtPzUsGTiqL9zd8ohjZYQcwu6lom7', 'cardano'); - invalid('DdzFFzCqrhsfdzUZxvuBkhV8Lpm9p43p9ubh79GCTkxJikAjKh51qhtCFMqUniC5tv5ZExyvSmAte2Du2tGimavSo6qSgXbjiy8qZRTg1', 'cardano'); - invalid('DdzFFzCqrhsfdzUZxvuBkhV8Lpm9p43p9ubh79GCTkxJikAjKh51qhtCFMqUniC5tv5ZExyvSmAte2Du2tGimavSo6qSgXbjiy8qZRT', 'ada'); - //invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'komodo', 'testnet'); - }); - - it('should return false for incorrect monero addresses', function () { - commonTests('monero'); - invalid('4AWygwA3hHNE4e4Yr9PtRWJiorXTjZkCi57g4ExYzfXDFFQ8DRFEFyui1dLqVknpqQjGUBdTMbgaFAZaDbrVHdk3GAKBZ3E', 'monero'); - invalid('44643dtxcxjgMWEQLo6mh1c4d9Zxx9GbgK9hEj9iGSiFEryCkbwHyJ3JqxZJRqeC3Hb7ZBLKq5NkaJwR1x95EYnR1bTgN6d', 'xmr'); - invalid('A17N9ztrxjQD3v3JJtHGvHVnq6BAbujDNEuensB6PFwBYFpkjAicih8hDtX76HBuEag5NeaCuMZmRMe6eE5NMRGxFTQn8nJ', 'monero', 'testnet'); - - //integrated - invalid('4LNSCKNSTPNbJYkyAEgL966eHJHLDHiq1PpwKoiFBybcSqNGYfLBJApC62uQEeGAFxfYEd29uXBBrJFo7DhKqFVNi3GhmN79EtD5dgycYz', 'monero'); - invalid('4JpzTwf3i1GeCV76beVr19179oa8j1L8xNSC1bXMtAxxdf4aTTLqubL8EvXfQmUGKt9MMigFtKy91VtoTTSfg1LU7LocPruT6KcGC9RKJV', 'xmr'); - }); - - it('should return false for incorrect waves addresses', function () { - commonTests('waves'); - invalid('3P93mVrYnQ4ahaRMYwA2BeWY32eDxTpLVEs1', 'waves'); - invalid('3P4eeU7v1LMHQFwwT2GW9W99c6vZyytHaj', 'waves'); - invalid('2P93mVrYnQ4ahaRMYwA2BeWY32eDxTpLVEs', 'waves'); - - invalid('3Myrq5QDgRq3nBVRSSv9UYRP36xTtpJND5y', 'waves', 'testnet'); - invalid('3My3KZgFQ3CrVHgz6vGRt8787sH4oAA1qp8', 'waves', 'testnet'); - }); - - it('should return false for incorrect nano addresses', function () { - commonTests('nano'); - invalid('xrb_1f5e4w33ndqbkx4bw5jtp13kp5xghebfxcmw9hdt1f7goid1s4373w6tjdgu', 'nano'); - invalid('nano_1f5e4w33ndqbkx4bw5jtp13kp5xghebfxcmw9hdt1f7goid1s4373w6tjdgu', 'nano'); - invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'nano'); - invalid('nano_111111111111111111111111111111111111111111111111111hifc8npp', 'nano'); - }); - - it('should return false for incorrect siacoin addresses', function () { - commonTests('siacoin') - invalid( - 'ffe1308c044ade30392a0cdc1fd5a4dbe94f9616a95faf888ed36123d9e711557aa497530372', - 'siacoin' - ) - }) - - it('should return false for incorrect lbry addresses', function () { - commonTests('lbc') - invalid('ffe1308c044ade30392a0cdc1fd5a4dbe94f9616a95faf888ed36123d9e711557aa497530372') - }) - - it('should return false for incorrect tron addresses', function () { - commonTests('trx'); - invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'trx'); - invalid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg31', 'trx'); - }); - - it('should return false for incorrect nem addresses', function () { - commonTests('nem'); - invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'nem'); - invalid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg31', 'nem'); - - invalid('3Myrq5QDgRq3nBVRSSv9UYRP36xTtpJND5y', 'nem', 'testnet'); - invalid('3My3KZgFQ3CrVHgz6vGRt8787sH4oAA1qp8', 'nem', 'testnet'); - }); - //15823701926930889868L - it('should return false for incorrect lsk addresses', function () { - commonTests('lsk'); - invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'lsk'); - invalid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg31', 'lsk'); - - invalid('158237019269308898689L', 'lsk'); - invalid('158237A192B930C898689L', 'lsk'); - }); - - it('should return false for incorrect bsv addresses', function () { - commonTests('bsv'); - invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'bsv'); - invalid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg31', 'bsv'); - - invalid('158237019269308898689L', 'bsv'); - invalid('158237A192B930C898689L', 'bsv'); - invalid('bitcoin:qzpuefrpg3kl2ykQe52rxn96pd3Kp4qudywr5pyrsf', 'bsv'); - invalid('pzuefrpg3kl2ykqe52rxn96pd3kp4qudywr5py', 'bsv'); - invalid('rlt2c2wuxr644encp3as0hygtj9djrsaumku3cex5', 'bsv'); - invalid('qra607y4wnkmnpy3wcmrxmltzkrxywcq85c7watpdx09', 'bsv'); - }); - - it('should return false for incorrect stellar addresses', function () { - commonTests('stellar'); - invalid('SBGWKM3CD4IL47QN6X54N6Y33T3JDNVI6AIJ6CD5IM47HG3IG4O36XCU', 'stellar'); - invalid('GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL', 'stellar'); - invalid('GCFZB6L25D26RQFDWSSBDEYQ32JHLRMTT44ZYE3DZQUTYOL7WY43PLBG++', 'stellar'); - invalid('GADE5QJ2TY7S5ZB65Q43DFGWYWCPHIYDJ2326KZGAGBN7AE5UY6JVDRRA', 'stellar'); - invalid('GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2', 'stellar'); - invalid('GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2T', 'stellar'); - invalid('GDXIIZTKTLVYCBHURXL2UPMTYXOVNI7BRAEFQCP6EZCY4JLKY4VKFNLT', 'stellar'); - invalid('SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDY', 'stellar'); - invalid('gWRYUerEKuz53tstxEuR3NCkiQDcV4wzFHmvLnZmj7PUqxW2wt', 'stellar'); - invalid('g4VPBPrHZkfE8CsjuG2S4yBQNd455UWmk', 'stellar'); - }); - - it('should return false for incorrect xtz(tezos) address', function () { - commonTests('xtz'); - invalid('SBGWKM3CD4IL47QN6X54N6Y33T3JDNVI6AIJ6CD5IM47HG3IG4O36XCU', 'xtz'); - invalid('GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL', 'xtz'); - invalid('GCFZB6L25D26RQFDWSSBDEYQ32JHLRMTT44ZYE3DZQUTYOL7WY43PLBG', 'xtz'); - invalid('tz1RR6wy9BeXG3Fjk25YmkSMGHxTtKkhpX', 'xtz'); - invalid('tz1h3rQ8wBxFd8L9B3d7JhaPQawu6Z568XU3xY', 'xtz'); - invalid('tz1Lhf4J9Qxoe4DZ2nfe8FGDnvVj7oKjnMY6', 'xtz'); - invalid('KT1E2LvxxFGB3Svh9p9HCP2jEEYyHjABMbK', 'xtz'); - - }); - - it('should return false for incorrect eos addresses', function () { - commonTests('eos'); - invalid('1234567890123', 'eos'); - invalid('12345678901', 'eos'); - invalid('12345678901@', 'eos'); - }); - - it('should return true for correct groestlcoin addresses', function () { - valid('Foa6yZoKq2r4t3tUFKFcfoXSQjSodZsGx1', 'groestlcoin'); - valid('Fr2Z1bLzqRZByt2WeZwWnpCkA1eBYv83wZ', 'groestlcoin'); - valid('Fr2Z1bLzqRZByt2WeZwWnpCkA1eBYv83wZ', 'GRS'); - valid('Fr2Z1bLzqRZByt2WeZwWnpCkA1eBYv83wZ', 'Groestlcoin'); - valid('Fr2Z1bLzqRZByt2WeZwWnpCkA1eBYv83wZ', 'grs'); - valid('Fr2Z1bLzqRZByt2WeZwWnpCkA1eBYv83wZ', 'grs', 'prod'); - valid('Fr2Z1bLzqRZByt2WeZwWnpCkA1eBYv83wZ', 'grs', 'both'); - valid('FpM19fiGQNjNcaRjFaXVX6Nrewr4gnuuMZ', 'grs', 'prod'); - valid('3FyVFsEyyBPzHjD3qUEgX7Jsn4tcJWiqeN', 'grs', 'prod'); - valid('38mKdURe1zcQyrFqRLzR8PRao3iLFU5hwU', 'grs', 'prod'); - valid('mptPo5AvLzJXi4T82vR6g82fT5uJ9cgfsV', 'grs', 'both'); - valid('FdWcvgskHoXUTqeQRAiuGuh5KQ2EoXv5iM', 'groestlcoin'); - valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWq3SbMQT', 'groestlcoin', 'testnet'); - valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWq3SbMQT', 'groestlcoin', 'both'); - - // p2sh addresses - valid('3NJZLcZEEYBpxYEUGewU4knsQRn1T2Htk2', 'groestlcoin'); - valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfZDahUf', 'groestlcoin', 'testnet'); - - // segwit addresses - //valid('grs1q49qls5kklryt95g5xx4p6msycpgjp8ramfc9jq', 'groestlcoin'); - //valid('tgrs1qgjd3qhncsxdyh5gt7hz4k6zzvfguslwxwgv23j', 'groestlcoin'); - - //invalid("grs1q49qls5kklryt95g5xq4p6msycpgjp8ramfc9jq", 'groestlcoin'), - //invalid("tgrs1qqjd3qhncsxdyh5gt7hz4k6zzvfguslwxwgv23j", 'groestlcoin') - - }); + describe('valid results', function () { + it('should return true for correct bitcoin addresses', function () { + valid('12KYrjTdVGjFMtaxERSk3gphreJ5US8aUP', 'bitcoin'); + valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'bitcoin'); + valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'BTC'); + valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'Bitcoin'); + valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'btc'); + valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'btc', 'prod'); + valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'btc', 'both'); + valid('15uwigGExiNQxTNr1QSZYPXJMp9Px2YnVU', 'btc', 'prod'); + valid('3FyVFsEyyBPzHjD3qUEgX7Jsn4tcHNZFkn', 'btc', 'prod'); + valid('38mKdURe1zcQyrFqRLzR8PRao3iLGEPVsU', 'btc', 'prod'); + valid('mptPo5AvLzJXi4T82vR6g82fT5uJ6HsQCu', 'btc', 'both'); + valid('1oNLrsHnBcR6dpaBpwz3LSwutbUNkNSjs', 'bitcoin'); + valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'bitcoin', 'testnet'); + valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'bitcoin', 'both'); + + valid('1SQHtwR5oJRKLfiWQ2APsAd9miUc4k2ez'); + valid('116CGDLddrZhMrTwhCVJXtXQpxygTT1kHd'); + + // p2sh addresses + valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt'); + valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'bitcoin'); + valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'bitcoin', 'testnet'); + + // regtest + valid('GSa5espVLNseXEfKt46zEdS6jrPkmFghBU', 'bitcoin', 'testnet'); + + // segwit addresses + valid('BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4', 'bitcoin'); + valid('tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7', 'bitcoin'); + valid('bc1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k7grplx', 'bitcoin'); + valid('BC1SW50QA3JX3S', 'bitcoin'); + valid('bc1zw508d6qejxtdg4y5r3zarvaryvg6kdaj', 'bitcoin'); + valid('tb1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesrxh6hy', 'bitcoin'); + + invalid("tc1qw508d6qejxtdg4y5r3zarvary0c5xw7kg3g4ty", 'bitcoin'), + invalid("bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t5", 'bitcoin'), + invalid("BC13W508D6QEJXTDG4Y5R3ZARVARY0C5XW7KN40WF2", 'bitcoin'), + invalid("bc1rw5uspcuh", 'bitcoin'), + invalid("bc10w508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7kw5rljs90", 'bitcoin'), + invalid("BC1QR508D6QEJXTDG4Y5R3ZARVARYV98GJ9P", 'bitcoin'), + invalid("tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sL5k7", 'bitcoin'), + invalid("bc1zw508d6qejxtdg4y5r3zarvaryvqyzf3du", 'bitcoin'), + invalid("tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3pjxtptv", 'bitcoin'), + invalid("bc1gmk9yu", 'bitcoin') }); + + it('should return true for correct bitcoincash addresses', function () { + valid('12KYrjTdVGjFMtaxERSk3gphreJ5US8aUP', 'bitcoincash'); + valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'bitcoincash'); + valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'BCH'); + valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'Bitcoin'); + valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'bch'); + valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'bch', 'prod'); + valid('12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y', 'bch', 'both'); + valid('1oNLrsHnBcR6dpaBpwz3LSwutbUNkNSjs', 'bitcoincash'); + valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'bitcoincash', 'testnet'); + valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'bitcoincash', 'both'); + + // p2sh addresses + valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'bitcoincash'); + valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'bitcoincash', 'testnet'); + + valid('bitcoincash:qq4v32mtagxac29my6gwj6fd4tmqg8rysu23dax807', 'bch'); + + }); + + it('should return true for correct litecoin addresses', function () { + valid('LVg2kJoFNg45Nbpy53h7Fe1wKyeXVRhMH9', 'litecoin'); + valid('LVg2kJoFNg45Nbpy53h7Fe1wKyeXVRhMH9', 'LTC'); + valid('LTpYZG19YmfvY2bBDYtCKpunVRw7nVgRHW', 'litecoin'); + valid('Lb6wDP2kHGyWC7vrZuZAgV7V4ECyDdH7a6', 'litecoin'); + valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'litecoin', 'testnet'); + + // p2sh addresses + valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'litecoin'); + valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'litecoin', 'testnet'); + valid('QW2SvwjaJU8LD6GSmtm1PHnBG2xPuxwZFy', 'litecoin', 'testnet'); + valid('QjpzxpbLp5pCGsCczMbfh1uhC3P89QZavY', 'litecoin', 'testnet'); + }); + + it('should return true for correct peercoin addresses', function () { + valid('PHCEsP6od3WJ8K2WKWEDBYKhH95pc9kiZN', 'peercoin'); + valid('PSbM1pGoE9dnAuVWvpQqTTYVpKZU41dNAz', 'peercoin'); + valid('PUULeHrJL2WujJkorc2RsUAR3SardKUauu', 'peercoin'); + valid('PUULeHrJL2WujJkorc2RsUAR3SardKUauu', 'PPC'); + valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'peercoin', 'testnet'); + + // p2sh addresses + valid('pNms4CaWqgZUxbNZaA1yP2gPr3BYnez9EM', 'peercoin'); + valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'peercoin', 'testnet'); + }); + + it('should return true for correct dogecoin addresses', function () { + valid('DPpJVPpvPNP6i6tMj4rTycAGh8wReTqaSU', 'dogecoin'); + valid('DNzLUN6MyYVS5zf4Xc2yK69V3dXs6Mxia5', 'dogecoin'); + valid('DPS6iZj7roHquvwRYXNBua9QtKPzigUUhM', 'dogecoin'); + valid('DPS6iZj7roHquvwRYXNBua9QtKPzigUUhM', 'DOGE'); + //TODO: NEED A DOGECOIN TESTNET ADDRESS + + //p2sh addresses + valid('A7JjzK9k9x5b2MkkQzqt91WZsuu7wTu6iS', 'dogecoin'); + valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'dogecoin', 'testnet'); + }); + + it('should return true for correct beavercoin addresses', function () { + valid('BPPtB4EpPi5wCaGXZuNyKQgng8ya579qUh', 'beavercoin'); + valid('BC1LLYoE4mTCHTJhVYvLGxhRTwAHyWTQ49', 'beavercoin'); + valid('BBuyeg2vjtyFdMNj3LTxuVra4wJMKVAY9C', 'beavercoin'); + valid('BBuyeg2vjtyFdMNj3LTxuVra4wJMKVAY9C', 'BVC'); + valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'beavercoin', 'testnet'); + + // p2sh addresses + valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'beavercoin'); + valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'beavercoin', 'testnet'); + }); + + it('should return true for correct freicoin addresses', function () { + valid('1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa', 'freicoin'); + valid('1oNLrsHnBcR6dpaBpwz3LSwutbUNkNSjs', 'freicoin'); + valid('1SQHtwR5oJRKLfiWQ2APsAd9miUc4k2ez', 'freicoin'); + valid('1SQHtwR5oJRKLfiWQ2APsAd9miUc4k2ez', 'FRC'); + valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'freicoin', 'testnet'); + + // p2sh addresse + valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'freicoin'); + valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'freicoin', 'testnet'); + }); + + it('should return true for correct protoshares addresses', function () { + valid('PaNGELmZgzRQCKeEKM6ifgTqNkC4ceiAWw', 'protoshares'); + valid('Piev8TMX2fT5mFtgxx2TXJaqXP37weMPuD', 'protoshares'); + valid('PgsuLoe9ojRKFGJGVpqqk37gAqNJ4ozboD', 'protoshares'); + valid('PgsuLoe9ojRKFGJGVpqqk37gAqNJ4ozboD', 'PTS'); + valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'protoshares', 'testnet'); + + //p2sh addresses + valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'protoshares'); + valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'protoshares', 'testnet'); + }); + + it('should return true for correct megacoin addresses', function () { + valid('MWUHaNxjXGZUYTh92i3zuDmsnH1rHSBk5M', 'megacoin'); + valid('MSAkrhRyte7bz999Ga5SqYjzypFFYa2oEb', 'megacoin'); + valid('MLUTAtDQFcfo1QACWocLuufFq5fBDTpCHE', 'megacoin'); + valid('MLUTAtDQFcfo1QACWocLuufFq5fBDTpCHE', 'MEC'); + valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'megacoin', 'testnet'); + + //p2sh addresses + valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'megacoin'); + valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'megacoin', 'testnet'); + }); + + it('should return true for correct primecoin addresses', function () { + valid('AVKeiZ5JadfWdH2EYVgVRfX4ufoyd4ehuM', 'primecoin'); + valid('AQXBRPyob4dywUJ21RUKrR1xetQCDVenKD', 'primecoin'); + valid('ANHfTZnskKqaBU7oZuSha9SpbHU3YBfeKf', 'primecoin'); + valid('AYdiYMKSGYxLcZNDmqB8jNcck7SQibrfiK', 'primecoin'); + valid('AYdiYMKSGYxLcZNDmqB8jNcck7SQibrfiK', 'XPM'); + valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'primecoin', 'testnet'); + + //p2sh addresses + valid('af5CvTQq7agDh717Wszb5QDbWb7nT2mukP', 'primecoin'); + valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'primecoin', 'testnet'); + }); + + it('should return true for correct auroracoin addresses', function () { + valid('ARM3GLZXF1PDTZ5vz3wh5MVahbK9BHTWAN', 'auroracoin'); + valid('AUtfc6ThCLb7FuEu7QPrWpJuaXaJRPciDF', 'auroracoin'); + valid('AUN1oaj5hjispGnczt8Aruw3TxgGyRqB3V', 'auroracoin'); + valid('AXGcBkGX6NiaDXj85C5dCrhTRUgwxSkKDK', 'auroracoin'); + valid('AXGcBkGX6NiaDXj85C5dCrhTRUgwxSkKDK', 'AUR'); + valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'auroracoin', 'testnet'); + + //p2sh addresses + valid('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'auroracoin'); + valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'auroracoin', 'testnet'); + }); + + it('should return true for correct namecoin addresses', function () { + valid('NEpeRmS775fnti8TDgJA28m8KLEfNNRZvT', 'namecoin'); + valid('MyJ691bGJ48RBK2LS8n1U57wcFLFScFXxi', 'namecoin'); + valid('NFY9aw1RXLGtWpeqgNQXprnUcZXyKNinTh', 'namecoin'); + valid('NCPPc7Pzb75CpRPJQPRRh6ouJTq7BCy1H4', 'namecoin'); + valid('NCPPc7Pzb75CpRPJQPRRh6ouJTq7BCy1H4', 'NMC'); + }); + + it('should return true for correct BioCoin addresses', function () { + valid('B7xseoLGk7hEpMDDeSvZDKmmiAMHWiccok', 'biocoin'); + valid('B8zjmYFGhWmiaQSJshfrnefE72xCapCkvo', 'biocoin'); + valid('muH8LL42DiMs8GEQ6Grfi8KUw2uFvuKr1J', 'biocoin', 'testnet'); + valid('muH8LL42DiMs8GEQ6Grfi8KUw2uFvuKr1J', 'BIO', 'testnet'); + valid('B8zjmYFGhWmiaQSJshfrnefE72xCapCkvo', 'BIO'); + }); + + it('should return true for correct Garlicoin addresses', function () { + valid('GU2NtcNotWFiZjTp2Vdgf5CjeMfgsWYCua', 'garlicoin'); + valid('GNWeWaoQ6rv21ZFjJWT9vb91hXUzFTLkru', 'garlicoin'); + valid('mjKbQTkgwzmsL3J86tdVzhyW9pc4NePqTb', 'garlicoin', 'testnet'); + valid('mnYp36NuyRavMKQ9Q9Q6oGqoorAs9p3zYn', 'GRLC', 'testnet'); + valid('GU2NtcNotWFiZjTp2Vdgf5CjeMfgsWYCua', 'GRLC'); + }); + + it('should return true for correct Vertcoin addresses', function () { + valid('3PgeyhEJEnS5CeBu3iFcu3JHVKemeHx1AW', 'VTC'); + valid('353nERPQKhGj4WGzoiWcareA76TPgRCVNA', 'VTC'); + valid('376g4TmL8uQKFYsRFrbv5iz9srmb5bocEt', 'VTC'); + valid('3AMtM4Zk5oNHu9i4jDiwKB6Kg5YEReBsav', 'VTC'); + + valid('VmoMjGf3zgZLy8sk3PMKd3xikZHXWvnYi7', 'vertcoin'); + valid('VmhHwXr3J8xMZpy62WuBGpu3xVvThWzcTQ', 'vertcoin'); + valid('mvww6DEJ18dbyQUukpVQXvLgrNDJazZn1Y', 'vertcoin', 'testnet'); + valid('mn3mdEE6cf1snxVsknNz4GRTdSrWXqYp7c', 'VTC', 'testnet'); + valid('Vri6Q4GgNFfdtcpxD961TotJwaSaYQCaL5', 'VTC'); + }); + + it('should return true for correct BitcoinGold addresses', function () { + valid('GW3JrQyHtoVfEFES3Y9JagiX3VSKQStLwj', 'bitcoingold'); + valid('GUDWdeMyAXQbrNFFivAhkJQ1GfBCFdc7JF', 'bitcoingold'); + valid('mvww6DEJ18dbyQUukpVQXvLgrNDJazZn1Y', 'bitcoingold', 'testnet'); + valid('mn3mdEE6cf1snxVsknNz4GRTdSrWXqYp7c', 'BTG', 'testnet'); + valid('GSNFPRsdaM3MXrU5HW1AxgFwmUQC8HXK9F', 'BTG'); + }); + + it('should return true for correct Decred addresses', function () { + valid('Dsesax2GJnMN4wwmWo5rJGq73dDK217Rh85', 'DCR'); + valid('DsYuxtvGRfN8rncXAndtLUpJm55F77K17RA', 'decred'); + valid('DsaXDG2NrJW8g4tFAb8n9MNx81Sn3Qc8AEV', 'decred'); + valid('TsijUgejaRnLKF5WAbpUxNtwKGUiKVeXLr7', 'decred', 'testnet'); + valid('TsZ9QmAoadF12hGvyALp6qvaF4be3BmLqG9', 'dcr', 'testnet'); + }); + + it('should return true for correct Digibyte addresses', function () { + valid('DG2rM2orU2JH5i4ACh3AKNpRTNESdv5xf8', 'DGB'); + valid('DBR2Lj1F17eHGHXgbpae2Wb4m39bDyA1qo', 'DGB'); + valid('D9TDZTR9Z9Mx2NoDJnhqhnYhDLKRAmsL9n', 'digibyte'); + valid('DHRzA1YHA1kFWpz2apRckZJy6KZRyGq4EV', 'digibyte'); + valid('DJ53hTyLBdZp2wMi5BsCS3rtEL1ioYUkva', 'digibyte'); + }); + + it('should return true for correct Ethereum addresses', function () { + valid('0xE37c0D48d68da5c5b14E5c1a9f1CFE802776D9FF', 'ethereum'); + valid('0xa00354276d2fC74ee91e37D085d35748613f4748', 'ethereum'); + valid('0xAff4d6793F584a473348EbA058deb8caad77a288', 'ETH'); + valid('0xc6d9d2cd449a754c494264e1809c50e34d64562b', 'ETH'); + valid('0x52908400098527886E0F7030069857D2E4169EE7', 'ETH'); + valid('0x8617E340B3D01FA5F11F306F4090FD50E238070D', 'ETH'); + valid('0xde709f2102306220921060314715629080e2fb77', 'ETH'); + valid('0x27b1fdb04752bbc536007a920d24acb045561c26', 'ETH'); + valid('0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed', 'ETH'); + valid('0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359', 'ETH'); + valid('0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB', 'ETH'); + valid('0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', 'ETH'); + + valid('0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', 'ethereumclassic'); + valid('0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', 'ETC'); + valid('0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', 'etherzero'); + valid('0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', 'ETZ'); + valid('0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', 'callisto'); + valid('0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb', 'CLO'); + }); + + it('should return true for correct Ripple addresses', function () { + valid('rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn', 'ripple'); + valid('rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn', 'XRP'); + valid('r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV', 'XRP'); + valid('rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', 'XRP'); + valid('rDTXLQ7ZKZVKz33zJbHjgVShjsBnqMBhmN', 'XRP'); + }); + + it('should return true for correct dash addresses', function () { + valid('Xx4dYKgz3Zcv6kheaqog3fynaKWjbahb6b', 'dash'); + valid('XcY4WJ6Z2Q8w7vcYER1JypC8s2oa3SQ1b1', 'DASH'); + valid('XqMkVUZnqe3w4xvgdZRtZoe7gMitDudGs4', 'dash'); + valid('yPv7h2i8v3dJjfSH4L3x91JSJszjdbsJJA', 'dash', 'testnet'); + valid('XoAAqv3oUYZ6xRjX3brfbf9PotrGanS6Th', 'dash'); + valid('yP5oXZQXBfBf9FyfZDpFiKDypxuNUKUV2E', 'dash', 'testnet'); + }); + + it('should return true for correct neo addresses', function () { + valid('AR4QmqYENiZAD6oXe7ftm6eDcwtHk7rVTT', 'neo'); + valid('AKDVzYGLczmykdtRaejgvWeZrvdkVEvQ1X', 'NEO'); + }); + + it('should return true for correct neo gas addresses', function () { + valid('AR4QmqYENiZAD6oXe7ftm6eDcwtHk7rVTT', 'neogas'); + }); + + it('should return true for correct qtum addresses', function () { + valid('QNjUiD3bVVZwYTc5AhpeQbS1mfb2guyWhe', 'qtum'); + valid('QVZnSrMwKp6AL4FjUPPnfFgsma6j1DXQXu', 'QTUM'); + valid('MCgyroQse81wuv5RwPpY5DXDNxeafzLFJ8', 'QTUM'); + valid('QQYySVc5WEe3g6PnNFYmspqG5CfSG8rnma', 'QTUM'); + valid('MSvJQBJMZs1dhxz7UAWa2si4iyMD2FHQd5', 'QTUM'); + + valid('qcSLSxN1sngCWSrKFZ6UC7ri4hhVSdq9SU', 'qtum', 'testnet'); + valid('qJnbEdrm9ybjVqDCaX5SWNBHmZy2X7YbPT', 'qtum', 'testnet'); + valid('qchBPDUYswobzpDmY5DsTStt74sTYQtaQv', 'qtum', 'testnet'); + }); + + it('should return true for correct groestlcoin addresses', function () { + valid('Foa6yZoKq2r4t3tUFKFcfoXSQjSodZsGx1', 'groestlcoin'); + valid('Fr2Z1bLzqRZByt2WeZwWnpCkA1eBYv83wZ', 'groestlcoin'); + valid('Fr2Z1bLzqRZByt2WeZwWnpCkA1eBYv83wZ', 'GRS'); + valid('Fr2Z1bLzqRZByt2WeZwWnpCkA1eBYv83wZ', 'Groestlcoin'); + valid('Fr2Z1bLzqRZByt2WeZwWnpCkA1eBYv83wZ', 'grs'); + valid('Fr2Z1bLzqRZByt2WeZwWnpCkA1eBYv83wZ', 'grs', 'prod'); + valid('Fr2Z1bLzqRZByt2WeZwWnpCkA1eBYv83wZ', 'grs', 'both'); + valid('FpM19fiGQNjNcaRjFaXVX6Nrewr4gnuuMZ', 'grs', 'prod'); + valid('3FyVFsEyyBPzHjD3qUEgX7Jsn4tcJWiqeN', 'grs', 'prod'); + valid('38mKdURe1zcQyrFqRLzR8PRao3iLFU5hwU', 'grs', 'prod'); + valid('mptPo5AvLzJXi4T82vR6g82fT5uJ9cgfsV', 'grs', 'both'); + valid('FdWcvgskHoXUTqeQRAiuGuh5KQ2EoXv5iM', 'groestlcoin'); + valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWq3SbMQT', 'groestlcoin', 'testnet'); + valid('mzBc4XEFSdzCDcTxAgf6EZXgsZWq3SbMQT', 'groestlcoin', 'both'); + + // p2sh addresses + valid('3NJZLcZEEYBpxYEUGewU4knsQRn1T2Htk2', 'groestlcoin'); + valid('2MxKEf2su6FGAUfCEAHreGFQvEYrfZDahUf', 'groestlcoin', 'testnet'); + + // segwit addresses + valid('grs1q49qls5kklryt95g5xx4p6msycpgjp8ramfc9jq', 'groestlcoin'); + valid('tgrs1qgjd3qhncsxdyh5gt7hz4k6zzvfguslwxwgv23j', 'groestlcoin'); + + invalid("grs1q49qls5kklryt95g5xq4p6msycpgjp8ramfc9jq", 'groestlcoin'), + invalid("tgrs1qqjd3qhncsxdyh5gt7hz4k6zzvfguslwxwgv23j", 'groestlcoin') + + }); + + it('should return true for correct votecoin addresses', function () { + valid('t1U9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'votecoin'); + valid('t3Vz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'VOT'); + valid('t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'votecoin', 'testnet'); + }); + + it('should return true for correct bitcoinz addresses', function () { + valid('t1U9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'bitcoinz'); + valid('t3Vz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'BTCZ'); + valid('t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'bitcoinz', 'testnet'); + }); + + it('should return true for correct zclassic addresses', function () { + valid('t1U9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'zclassic'); + valid('t3Vz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'ZCL'); + valid('t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'zclassic', 'testnet'); + }); + + it('should return true for correct hush addresses', function () { + valid('t1U9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'hush'); + valid('t3Vz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'HUSH'); + valid('t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'hush', 'testnet'); + }); + + it('should return true for correct zcash addresses', function () { + valid('t1U9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'zcash'); + valid('t3Vz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'ZEC'); + valid('t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'zcash', 'testnet'); + }); + + it('should return true for correct bitcoinprivate addresses', function () { + valid('b1M4XXPFhwMb1SP33yhzn3h9qWXjujkgep4', 'bitcoinprivate'); + //valid('bx....', 'BTCP'); + //valid('nx....', 'bitcoinprivate', 'testnet'); + }); + + it('should return true for correct snowgem addresses', function () { + valid('s1fx7WBkjB4UH6qQjPp6Ysmtr1C1JiTK2Yw', 'snowgem'); + valid('s3d27MhkBRt3ha2UuxhjXaYF4DCnttTMnL1', 'SNG'); + valid('t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'snowgem', 'testnet'); + }); + + it('should return true for correct zencash addresses', function () { + valid('znhiGGfYRepxkBjXYvA2kFrXiC351i9ta4z', 'zencash'); + valid('zssEdGnZCQ9G86LZFtbynMn1hYTVhn6eYCL', 'ZEN'); + valid('ztmWMDLWjbruCJxKmmfAZiT6QAQdiv5F291', 'zencash', 'testnet'); + }); + + it('should return true for correct komodo addresses', function () { + valid('R9R5HirAzqDcWrWGiJEL115dpV3QB3hobH', 'komodo'); + valid('RAvj2KKVUohTu3hVdNJ4U6hQi7TNawpacH', 'KMD'); + //valid('t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'komodo', 'testnet'); + }); + + it('should return true for correct Bankex addresses', function () { + valid('0xeac39e1bc802baae3d4b9cb518f3f60374bbad6c', 'bankex'); + valid('0x45245bc59219eeaaf6cd3f382e078a461ff9de7b', 'BKX'); + valid('0xf40d80FCfa5cdEa0bB1E570c2D52132ac9bC6aEC', 'bankex', 'testnet'); + valid('0x8A7395f281EeCf2B471B689E87Cf4C7fa8bb957d', 'BKX', 'testnet'); + }); + + + it('should return true for correct Cardano addresses', function () { + valid('Ae2tdPwUPEYzs5BRbGcoS3DXvK8mwgggmESz4HqUwMyaS9eNksZGz1LMS9v', 'ada'); + valid('Ae2tdPwUPEYxYNJw1He1esdZYvjmr4NtPzUsGTiqL9zd8ohjZYQcwu6kom7', 'cardano'); + valid('DdzFFzCqrhsfdzUZxvuBkhV8Lpm9p43p9ubh79GCTkxJikAjKh51qhtCFMqUniC5tv5ZExyvSmAte2Du2tGimavSo6qSgXbjiy8qZRTg', 'ada'); + valid('Ae2tdPwUPEZKmwoy3AU3cXb5Chnasj6mvVNxV1H11997q3VW5ihbSfQwGpm', 'ada'); + valid('4swhHtxKapQbj3TZEipgtp7NQzcRWDYqCxXYoPQWjGyHmhxS1w1TjUEszCQT1sQucGwmPQMYdv1FYs3d51KgoubviPBf', 'cardano'); + }); + + it('should return true for correct monero addresses', function () { + valid('47zQ5LAivg6hNCgijXSEFVLX7mke1bgM6YGLFaANDoJbgXDymcAAZvvMNt2PmMpqEe5qRy2zyfMYXdwpmdyitiFh84xnPG2', 'monero'); + valid('48bWuoDG75CXMDHbmPEvUF2hm1vLDic7ZJ7hqRkL65QR9p13AQAX4eEACXNk4YP115Q4KRVZnAvmMBHrcGfv9FvKPZnH6vH', 'XMR'); + valid('88WB4JKdQVhWfkc8cBT9EEJ6vejSAqKJHbV1dXBAXdpgQovtNDNRxfKCS7wB8rHQ5D5zH2Pd1YkyMNNQDie6ZfeZ311fPgn', 'XMR'); + valid('A2be3UvzMtkJtxRYgcCbQt2y7Rp2eLVGqNTWfZeankrWimSMM4y7uMP6B9oAZaHsXTj8KFSerkSkkVRuEuEca9QM8VhxCNU', 'monero', 'testnet'); + + //integrated addresses + valid('4Gd4DLiXzBmbVX2FZZ3Cvu6fUaWACup1qDowprUCje1kSP4FmbftiJMSfV8kWZXNqmVwj4m52xqtgFNUudVmsmGkGvkLcCibWfVUfUFVB7', 'monero'); + valid('4J5sF94AzXgFgx8LuWc9dcWkJkGkD3cL3L2AuhX6QA9jFvSxxj6QhHqHXqM2b2Go7G8RyDzEbHxYd9G26XUUbuJChipEyBz9fENMU2Ua9b', 'XMR'); + + valid('9uXRFi4PZMqhsnthBF6bGdfVnBSZtfKkR7Td8qPM7jUKZeTfR1tLhCoTLqYNE12xuiQg3aWGiLw83bWsqwTRLaM4Jk47xYM', 'XMR', 'testnet'); + valid('9tFTaQM39JXhULZsHauPHhjFrjcGSGXoijEPYoRgAky9Veck2mFp3EifQ2tKHmEHuuUoFfgYRNR2bVaborz5oi8JA8xkqjY', 'monero', 'testnet') + }); + + it('should return true for correct gamecredits addresses', function () { + valid('GU5BBtW9gxSKvAknvFi9yUaXKUNW9zUN2p', 'game'); + valid('GYxQMVzP6YpzX59QNRYqmJeHNtUMYSZPri', 'game'); + }); + + it('should return true for correct monacoin addresses', function () { + valid('MMN1Q1aRVUzanmg9DJjcRYzQSJQoBeQPui', 'mona'); + valid('PFMzNYnBm5X4c9qJkJPkfgdCyd9fuuy2vT', 'mona'); + valid('PCtN7VUYHW8w4g59BaphrfPs8g7pNgAzxn', 'mona'); + valid('MXCcYFGRmsd4d3CcQugFiqG8uarj5tVu76', 'mona'); + valid('MNK1pGsBf9WdoE54fZM9VFhkeYHW6VUf2u', 'mona'); + }); + + it('should return true for correct pivx addresses', function () { + valid('DJXFW9oJJBUX7QKrG6GKvmTs63MYKzwtpZ', 'pivx'); + valid('DEaYb8EHQgyKvX6VXDS3DZQautJrHBmK3T', 'pivx'); + valid('DDeCGR3QSgqsBxVR23bJvteiyYE34ZmxAc', 'pivx'); + valid('DSqQM8DPpBHHoZXHgRdwmaf6hZPEoZcFkh', 'pivx'); + }); + + it('should return true for correct solarcoin addresses', function () { + valid('8VxVLzwB26E2YZZ82o1NcQe96QSM2z6GwW', 'slr'); + valid('8YW5qcTjeyqX5kESsqu2BUdXiedgssegtQ', 'SolarCoin'); + }); + + it('should return true for correct tether addresses', function () { + valid('3MbYQMMmSkC3AgWkj9FMo5LsPTW1zBTwXL', 'usdt'); + valid('1KdXaqcBeoMAFVAPwTmYvDbEq6RnvNPF6J', 'tether'); + }); + + it('should return true for correct expanse addresses', function () { + valid('0xbab463743603a253bdf1f84975b1a9517505ae05', 'exp'); + valid('0x5d0777cb5d6977873904864c6ab531f4b3261f0b', 'expanse'); + }); + + it('should return true for correct waves addresses', function () { + valid('3P93mVrYnQ4ahaRMYwA2BeWY32eDxTpLVEs', 'waves'); + valid('3P4eeU7v1LMHQFwwT2GW9W99c6vZyytHajj', 'waves'); + + valid('3Myrq5QDgRq3nBVRSSv9UYrP36xTtpJND5y', 'waves', 'testnet'); + valid('3My3KZgFQ3CrVHgz6vGRt8687sH4oAA1qp8', 'waves', 'testnet'); + }); + + it('should return true for correct nano addresses', function () { + valid('xrb_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3', 'nano'); + valid('xrb_13ezf4od79h1tgj9aiu4djzcmmguendtjfuhwfukhuucboua8cpoihmh8byo', 'nano'); + valid('xrb_35jjmmmh81kydepzeuf9oec8hzkay7msr6yxagzxpcht7thwa5bus5tomgz9', 'nano'); + valid('xrb_1111111111111111111111111111111111111111111111111111hifc8npp', 'nano'); + valid('xrb_1ipx847tk8o46pwxt5qjdbncjqcbwcc1rrmqnkztrfjy5k7z4imsrata9est', 'nano'); + valid('xrb_3wm37qz19zhei7nzscjcopbrbnnachs4p1gnwo5oroi3qonw6inwgoeuufdp', 'nano'); + valid('xrb_3arg3asgtigae3xckabaaewkx3bzsh7nwz7jkmjos79ihyaxwphhm6qgjps4', 'nano'); + valid('xrb_1f5e4w33ndqbkx4bw5jtp13kp5xghebfxcmw9hdt1f7goid1s4373w6tjmgu', 'nano'); + valid('xrb_1q79ahdr36uqn38p5tp5sqwkn73rnpj1k8obtuetdbjcx37d5gahhd1u9cuh', 'nano'); + valid('nano_1q79ahdr36uqn38p5tp5sqwkn73rnpj1k8obtuetdbjcx37d5gahhd1u9cuh', 'nano'); + }); + + it('should return true for correct siacoin addresses', function () { + valid( + 'a9b01c85163638682b170d82de02b8bb99ba86092e9ab1b0d25111284fe618e93456915820f1', + 'siacoin' + ) + valid( + 'a9b01c85163638682b170d82de02b8bb99ba86092e9ab1b0d25111284fe618e93456915820f1', + 'siacoin' + ) + valid( + 'ab0c327982abfcc6055a6c9551589167d8a73501aca8769f106371fbc937ad100c955c3b7ba9', + 'siacoin' + ) + valid( + 'ffe1308c044ade30392a0cdc1fd5a4dbe94f9616a95faf888ed36123d9e711557aa497530373', + 'siacoin' + ) + }) + + it('should return true for correct loki addresses', function () { + // public + valid( + 'L63ymg8cb5aRz1PhXrEQ22PWw9KBhBS8rMsgqbABhTGFfh53U3Rc2iWCJpCPsHZT5hfyt7fPQa612a5Z1tBnGYEA9h6YHnn', + 'loki' + ) + valid( + 'L5QKRGMNpQU3eCAdjMVTCR631bRKqnW1oEWWBEHAtFJLieA5VvuxyyubCd9FczEEatg8jfy39UJZ13npLJqZG6dtMtM99ha', + 'loki' + ) + // integrated + valid( + 'LK8CGQ17G9R3ys3Xf33wCeViD2B95jgdpjAhcRsjuheJ784dumXn7g3RPAzedWpFq364jJKYL9dkQ8mY66sZG9BiD1xbPb6dpYo7toNRqk', + 'loki' + ) + valid( + 'LK8CGQ17G9R3ys3Xf33wCeViD2B95jgdpjAhcRsjuheJ784dumXn7g3RPAzedWpFq364jJKYL9dkQ8mY66sZG9BiCtWq1AYo1oJTVqgUcQ', + 'loki' + ) + // subaddress + valid( + 'LW1VMYcvWPZZJ2h1pKGEku2y9WeDiAU2VhgrgVgvjybaRuCdcEkg6FhXjVNSd37Bp7fhYH8tVa5T9VmRaYiWyxYdCpEGBg8', + 'loki' + ) + }) + + it('should return true for correct lbry addresses', function () { + valid('bDb6NmobyDVeNGpizWQQBZkYjKCRQBdKdG', 'LBC') + valid('bTFXPcV3a8iVDezogvHTHezWZ1mZGWpPDc', 'lbc') + valid('bK2uEVn6UuwjCTUZ1Dfj5HhWYi9BtqZDDm', 'lbc') + valid('bNEMVqeUZUqTrYUxud5ehnUhtTAiWDXQ5e', 'lbc') + }) + + it('should return true for correct trx addresses', function () { + valid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r', 'trx'); + valid('27bLJCYjbH6MT8DBF9xcrK6yZnm43vx7MNQ', 'trx', 'testnet'); + }); + + it('should return true for correct nem addresses', function () { + valid('NBZMQO7ZPBYNBDUR7F75MAKA2S3DHDCIFG775N3D', 'xem'); + valid('TDWTRGT6GVWCV7GRWFNI45S53PGOJBKNUF3GE6PB', 'xem', 'testnet'); + }); + + it('should return true for correct lsk addresses', function () { + valid('469226551L', 'lsk'); + valid('15823701926930889868L', 'lsk'); + valid('1657699692452120239L', 'lsk'); + valid('555666666999992L', 'lsk'); + valid('6853061742992593192L', 'lsk'); + valid('530464791801L', 'lsk'); + }); + + it('should return true for correct bsv addresses', function () { + valid('qzwryn9fxnpqkf7zt878tp2g9cg8kpl65qh2ml0w0r', 'bsv'); + valid('qp65yngy5uds4wxtrkynptal4f76qzmrh52pa3mpaf', 'bsv'); + valid('bitcoincash:qq4v32mtagxac29my6gwj6fd4tmqg8rysu23dax807', 'bsv'); + valid('qq4v32mtagxac29my6gwj6fd4tmqg8rysu23dax807', 'bsv'); + valid('qz97s7ee0rvwlymtxrwafmvs87x6027jwuf3wepug7', 'bsv'); + valid('bitcoincash:qpp32ssez340wfspnt79h6c4xds4fzf3m5j0cplx0l', 'bsv'); + valid('qqg82u7tq2eahs3gkh9m6kjnmjehr69m5v37alepq4', 'bsv'); + valid('bitcoincash:qrwkk9a3es2wu7mdvzh0vekfvjuzysq8tv7r3hcwr5', 'bsv'); + valid('1DrNXqCj2B8FKyx66RAWDkiEJhw2yrvhT3', 'bsv'); + }); + + it('should return true for correct stellar addresses', function () { + valid('GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', 'stellar'); + valid('GB7KKHHVYLDIZEKYJPAJUOTBE5E3NJAXPSDZK7O6O44WR3EBRO5HRPVT', 'stellar'); + valid('GD6WVYRVID442Y4JVWFWKWCZKB45UGHJAABBJRS22TUSTWGJYXIUR7N2', 'stellar'); + valid('GBCG42WTVWPO4Q6OZCYI3D6ZSTFSJIXIS6INCIUF23L6VN3ADE4337AP', 'stellar'); + valid('GDFX463YPLCO2EY7NGFMI7SXWWDQAMASGYZXCG2LATOF3PP5NQIUKBPT', 'stellar'); + valid('GBXEODUMM3SJ3QSX2VYUWFU3NRP7BQRC2ERWS7E2LZXDJXL2N66ZQ5PT', 'stellar'); + valid('GAJHORKJKDDEPYCD6URDFODV7CVLJ5AAOJKR6PG2VQOLWFQOF3X7XLOG', 'stellar'); + valid('GACXQEAXYBEZLBMQ2XETOBRO4P66FZAJENDHOQRYPUIXZIIXLKMZEXBJ', 'stellar'); + valid('GDD3XRXU3G4DXHVRUDH7LJM4CD4PDZTVP4QHOO4Q6DELKXUATR657OZV', 'stellar'); + valid('GDTYVCTAUQVPKEDZIBWEJGKBQHB4UGGXI2SXXUEW7LXMD4B7MK37CWLJ', 'stellar'); + }); + + it('should return true for correct xtz(tezos) address', function () { + valid('tz1Lhf4J9Qxoe3DZ2nfe8FGDnvVj7oKjnMY6', 'xtz'); + valid('tz1PyxsQ7xVTa5J7gtBeT7pST5Zi5nk5GSjg', 'xtz'); + valid('tz1LcuQHNVQEWP2fZjk1QYZGNrfLDwrT3SyZ', 'xtz'); + valid('tz1Lhf4J9Qxoe3DZ2nfe8FGDnvVj7oKjnMY6', 'xtz'); + valid('tz1RR6wETy9BeXG3Fjk25YmkSMGHxTtKkhpX', 'xtz'); + valid('tz1h3rQ8wBxFd8L9B3d7Jhaawu6Z568XU3xY', 'xtz'); + valid('KT1EM2LvxxFGB3Svh9p9HCP2jEEYyHjABMbK', 'xtz'); + }); + + it('should return true for correct eos addresses', function () { + valid('bittrexacct1', 'eos'); + valid('binancecleos', 'eos'); + valid('123456789012', 'eos'); + }); + }); + + describe('invalid results', function () { + function commonTests(currency) { + invalid('', currency); //reject blank + invalid('%%@', currency); //reject invalid base58 string + invalid('1A1zP1ePQGefi2DMPTifTL5SLmv7DivfNa', currency); //reject invalid address + invalid('bd839e4f6fadb293ba580df5dea7814399989983', currency); //reject transaction id's + //testnet + invalid('', currency, 'testnet'); //reject blank + invalid('%%@', currency, 'testnet'); //reject invalid base58 string + invalid('1A1zP1ePQGefi2DMPTifTL5SLmv7DivfNa', currency, 'testnet'); //reject invalid address + invalid('bd839e4f6fadb293ba580df5dea7814399989983', currency, 'testnet'); //reject transaction id's + } + + it('should return false for incorrect bitcoin addresses', function () { + commonTests('bitcoin'); + }); + + it('should return false for incorrect bitcoincash addresses', function () { + commonTests('bitcoincash'); + }); + + it('should return false for incorrect litecoin addresses', function () { + commonTests('litecoin'); + }); + + it('should return false for incorrect peercoin addresses', function () { + commonTests('peercoin'); + }); + + it('should return false for incorrect dogecoin addresses', function () { + commonTests('dogecoin'); + }); + + it('should return false for incorrect beavercoin addresses', function () { + commonTests('beavercoin'); + }); + + it('should return false for incorrect freicoin addresses', function () { + commonTests('freicoin'); + }); + + it('should return false for incorrect protoshares addresses', function () { + commonTests('protoshares'); + }); + + it('should return false for incorrect megacoin addresses', function () { + commonTests('megacoin'); + }); + + it('should return false for incorrect primecoin addresses', function () { + commonTests('primecoin'); + }); + + it('should return false for incorrect auroracoin addresses', function () { + commonTests('auroracoin'); + }); + + it('should return false for incorrect namecoin addresses', function () { + commonTests('namecoin'); + }); + + it('should return false for incorrect biocoin addresses', function () { + commonTests('biocoin'); + }); + + it('should return false for incorrect garlicoin addresses', function () { + commonTests('garlicoin'); + }); + + it('should return false for incorrect vertcoin addresses', function () { + commonTests('vertcoin'); + }); + + it('should return false for incorrect bitcoingold addresses', function () { + commonTests('bitcoingold'); + }); + + it('should return false for incorrect decred addresses', function () { + commonTests('decred'); + }); + + it('should return false for incorrect gamecredits addresses', function () { + commonTests('game'); + }); + + it('should return false for incorrect monacoin addresses', function () { + commonTests('mona'); + }); + + it('should return false for incorrect solarcoin addresses', function () { + commonTests('slr'); + }); + + it('should return false for incorrect tether addresses', function () { + commonTests('usdt'); + }); + + it('should return false for incorrect expanse addresses', function () { + commonTests('exp'); + }); + + it('should return false for incorrect usdt addresses', function () { + commonTests('usdt'); + }); + + it('should return false for incorrect bankex addresses', function () { + invalid('1SQHtwR5oJRKLfiWQ2APsAd9miUc4k2ez', 'bankex'); + invalid('116CGDLddrZhMrTwhCVJXtXQpxygTT1kHd', 'BKX'); + invalid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'bankex', 'testnet'); + invalid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'BKX', 'testnet'); + }); + + it('should return false for incorrect digibyte addresses', function () { + commonTests('digibyte'); + }); + + it('should return false for incorrect eip55 addresses', function () { + invalid('6xAff4d6793F584a473348EbA058deb8caad77a288', 'ethereum'); + invalid('0x02fcd51aAbB814FfFe17908fbc888A8975D839A5', 'ethereum'); + invalid('0XD1220A0CF47C7B9BE7A2E6BA89F429762E7B9ADB', 'ethereum'); + invalid('aFf4d6793f584a473348ebA058deb8caad77a2885', 'ethereum'); + invalid('0xff4d6793F584a473', 'ethereum'); + + invalid('0x02fcd51aAbB814FfFe17908fbc888A8975D839A5', 'ethereumclassic'); + invalid('0x02fcd51aAbB814FfFe17908fbc888A8975D839A5', 'etherzero'); + invalid('0x02fcd51aAbB814FfFe17908fbc888A8975D839A5', 'callisto'); + }); + + it('should return false for incorrect ripple addresses', function () { + invalid('rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCN', 'ripple'); + invalid('rDTXLQ7ZKZVKz33zJbHjgVShjsBnqMBhMN', 'XRP'); + invalid('6xAff4d6793F584a473348EbA058deb8ca', 'ripple'); + invalid('DJ53hTyLBdZp2wMi5BsCS3rtEL1ioYUkva', 'ripple'); + }); + + it('should return false for incorrect dash addresses', function () { + commonTests('dash'); + }); + + it('should return false for incorrect neo addresses', function () { + commonTests('neo'); + invalid('AR4QmqYENiZAD6oXe7ftm6eDcwtHk7rVTa', 'neo'); + invalid('AKDVzYGLczmykdtRaejgvWeZrvdkVEvQ10', 'NEO'); + }); + + it('should return false for incorrect qtum addresses', function () { + commonTests('qtum'); + invalid('QNPhBbVhDghASxcUh2vHotQUgNeLRFTcfb', 'qtum'); + invalid('QOPhBbVhDghASxcUh2vHotQUgNeLRFTcfa', 'QTUM'); + }); + + it('should return false for incorrect votecoin addresses', function () { + commonTests('votecoin'); + invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'votecoin'); + invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'VOT'); + invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'votecoin', 'testnet'); + }); + + it('should return false for incorrect bitcoinz addresses', function () { + commonTests('bitcoinz'); + invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'bitcoinz'); + invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'BTCZ'); + invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'bitcoinz', 'testnet'); + }); + + it('should return false for incorrect zclassic addresses', function () { + commonTests('zclassic'); + invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'zclassic'); + invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'ZCL'); + invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'zclassic', 'testnet'); + }); + + it('should return false for incorrect hush addresses', function () { + invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'hush'); + invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'HUSH'); + invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'hush', 'testnet'); + }); + + it('should return false for incorrect zcash addresses', function () { + commonTests('zcash'); + invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'zcash'); + invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'ZEC'); + invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'zcash', 'testnet'); + }); + + it('should return false for incorrect bitcoinprivate addresses', function () { + commonTests('bitcoinprivate'); + invalid('b1Y4XXPFhwMb1SP33yhzn3h9qWXjujkgep4', 'bitcoinprivate'); + //invalid('bx....', 'BTCP'); + //invalid('nx....', 'bitcoinprivate', 'testnet'); + }); + + it('should return false for incorrect snowgem addresses', function () { + commonTests('snowgem'); + invalid('s1Yx7WBkjB4UH6qQjPp6Ysmtr1C1JiTK2Yw', 'snowgem'); + invalid('s3Y27MhkBRt3ha2UuxhjXaYF4DCnttTMnL1', 'SNG'); + invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'snowgem', 'testnet'); + }); + + it('should return false for incorrect zencash addresses', function () { + commonTests('zencash'); + invalid('znYiGGfYRepxkBjXYvA2kFrXiC351i9ta4z', 'zencash'); + invalid('zsYEdGnZCQ9G86LZFtbynMn1hYTVhn6eYCL', 'ZEN'); + invalid('ztYWMDLWjbruCJxKmmfAZiT6QAQdiv5F291', 'zencash', 'testnet'); + }); + + it('should return false for incorrect komodo addresses', function () { + commonTests('komodo'); + invalid('R9Y5HirAzqDcWrWGiJEL115dpV3QB3hobH', 'komodo'); + invalid('RAYj2KKVUohTu3hVdNJ4U6hQi7TNawpacH', 'KMD'); + //invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'komodo', 'testnet'); + }); + + it('should return false for incorrect cardano addresses', function () { + commonTests('cardano'); + invalid('Ae2tdPwUPEYxYNJw1He1esdZYvjmr4NtPzUsGTiqL9zd8ohjZYQcwu6lom7', 'cardano'); + invalid('DdzFFzCqrhsfdzUZxvuBkhV8Lpm9p43p9ubh79GCTkxJikAjKh51qhtCFMqUniC5tv5ZExyvSmAte2Du2tGimavSo6qSgXbjiy8qZRTg1', 'cardano'); + invalid('DdzFFzCqrhsfdzUZxvuBkhV8Lpm9p43p9ubh79GCTkxJikAjKh51qhtCFMqUniC5tv5ZExyvSmAte2Du2tGimavSo6qSgXbjiy8qZRT', 'ada'); + //invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'komodo', 'testnet'); + }); + + it('should return false for incorrect monero addresses', function () { + commonTests('monero'); + invalid('4AWygwA3hHNE4e4Yr9PtRWJiorXTjZkCi57g4ExYzfXDFFQ8DRFEFyui1dLqVknpqQjGUBdTMbgaFAZaDbrVHdk3GAKBZ3E', 'monero'); + invalid('44643dtxcxjgMWEQLo6mh1c4d9Zxx9GbgK9hEj9iGSiFEryCkbwHyJ3JqxZJRqeC3Hb7ZBLKq5NkaJwR1x95EYnR1bTgN6d', 'xmr'); + invalid('A17N9ztrxjQD3v3JJtHGvHVnq6BAbujDNEuensB6PFwBYFpkjAicih8hDtX76HBuEag5NeaCuMZmRMe6eE5NMRGxFTQn8nJ', 'monero', 'testnet'); + + //integrated + invalid('4LNSCKNSTPNbJYkyAEgL966eHJHLDHiq1PpwKoiFBybcSqNGYfLBJApC62uQEeGAFxfYEd29uXBBrJFo7DhKqFVNi3GhmN79EtD5dgycYz', 'monero'); + invalid('4JpzTwf3i1GeCV76beVr19179oa8j1L8xNSC1bXMtAxxdf4aTTLqubL8EvXfQmUGKt9MMigFtKy91VtoTTSfg1LU7LocPruT6KcGC9RKJV', 'xmr'); + }); + + it('should return false for incorrect waves addresses', function () { + commonTests('waves'); + invalid('3P93mVrYnQ4ahaRMYwA2BeWY32eDxTpLVEs1', 'waves'); + invalid('3P4eeU7v1LMHQFwwT2GW9W99c6vZyytHaj', 'waves'); + invalid('2P93mVrYnQ4ahaRMYwA2BeWY32eDxTpLVEs', 'waves'); + + invalid('3Myrq5QDgRq3nBVRSSv9UYRP36xTtpJND5y', 'waves', 'testnet'); + invalid('3My3KZgFQ3CrVHgz6vGRt8787sH4oAA1qp8', 'waves', 'testnet'); + }); + + it('should return false for incorrect nano addresses', function () { + commonTests('nano'); + invalid('xrb_1f5e4w33ndqbkx4bw5jtp13kp5xghebfxcmw9hdt1f7goid1s4373w6tjdgu', 'nano'); + invalid('nano_1f5e4w33ndqbkx4bw5jtp13kp5xghebfxcmw9hdt1f7goid1s4373w6tjdgu', 'nano'); + invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'nano'); + invalid('nano_111111111111111111111111111111111111111111111111111hifc8npp', 'nano'); + }); + + it('should return false for incorrect siacoin addresses', function () { + commonTests('siacoin') + invalid( + 'ffe1308c044ade30392a0cdc1fd5a4dbe94f9616a95faf888ed36123d9e711557aa497530372', + 'siacoin' + ) + }) + + it('should return false for incorrect lbry addresses', function () { + commonTests('lbc') + invalid('ffe1308c044ade30392a0cdc1fd5a4dbe94f9616a95faf888ed36123d9e711557aa497530372') + }) + + it('should return false for incorrect tron addresses', function () { + commonTests('trx'); + invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'trx'); + invalid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg31', 'trx'); + }); + + it('should return false for incorrect nem addresses', function () { + commonTests('nem'); + invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'nem'); + invalid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg31', 'nem'); + + invalid('3Myrq5QDgRq3nBVRSSv9UYRP36xTtpJND5y', 'nem', 'testnet'); + invalid('3My3KZgFQ3CrVHgz6vGRt8787sH4oAA1qp8', 'nem', 'testnet'); + }); + //15823701926930889868L + it('should return false for incorrect lsk addresses', function () { + commonTests('lsk'); + invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'lsk'); + invalid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg31', 'lsk'); + + invalid('158237019269308898689L', 'lsk'); + invalid('158237A192B930C898689L', 'lsk'); + }); + + it('should return false for incorrect bsv addresses', function () { + commonTests('bsv'); + invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'bsv'); + invalid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg31', 'bsv'); + + invalid('158237019269308898689L', 'bsv'); + invalid('158237A192B930C898689L', 'bsv'); + invalid('bitcoin:qzpuefrpg3kl2ykQe52rxn96pd3Kp4qudywr5pyrsf', 'bsv'); + invalid('pzuefrpg3kl2ykqe52rxn96pd3kp4qudywr5py', 'bsv'); + invalid('rlt2c2wuxr644encp3as0hygtj9djrsaumku3cex5', 'bsv'); + invalid('qra607y4wnkmnpy3wcmrxmltzkrxywcq85c7watpdx09', 'bsv'); + }); + + it('should return false for incorrect stellar addresses', function () { + commonTests('stellar'); + invalid('SBGWKM3CD4IL47QN6X54N6Y33T3JDNVI6AIJ6CD5IM47HG3IG4O36XCU', 'stellar'); + invalid('GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL', 'stellar'); + invalid('GCFZB6L25D26RQFDWSSBDEYQ32JHLRMTT44ZYE3DZQUTYOL7WY43PLBG++', 'stellar'); + invalid('GADE5QJ2TY7S5ZB65Q43DFGWYWCPHIYDJ2326KZGAGBN7AE5UY6JVDRRA', 'stellar'); + invalid('GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2', 'stellar'); + invalid('GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2T', 'stellar'); + invalid('GDXIIZTKTLVYCBHURXL2UPMTYXOVNI7BRAEFQCP6EZCY4JLKY4VKFNLT', 'stellar'); + invalid('SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDY', 'stellar'); + invalid('gWRYUerEKuz53tstxEuR3NCkiQDcV4wzFHmvLnZmj7PUqxW2wt', 'stellar'); + invalid('g4VPBPrHZkfE8CsjuG2S4yBQNd455UWmk', 'stellar'); + }); + + it('should return false for incorrect xtz(tezos) address', function () { + commonTests('xtz'); + invalid('SBGWKM3CD4IL47QN6X54N6Y33T3JDNVI6AIJ6CD5IM47HG3IG4O36XCU', 'xtz'); + invalid('GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL', 'xtz'); + invalid('GCFZB6L25D26RQFDWSSBDEYQ32JHLRMTT44ZYE3DZQUTYOL7WY43PLBG', 'xtz'); + invalid('tz1RR6wy9BeXG3Fjk25YmkSMGHxTtKkhpX', 'xtz'); + invalid('tz1h3rQ8wBxFd8L9B3d7JhaPQawu6Z568XU3xY', 'xtz'); + invalid('tz1Lhf4J9Qxoe4DZ2nfe8FGDnvVj7oKjnMY6', 'xtz'); + invalid('KT1E2LvxxFGB3Svh9p9HCP2jEEYyHjABMbK', 'xtz'); + + }); + + it('should return false for incorrect eos addresses', function () { + commonTests('eos'); + invalid('1234567890123', 'eos'); + invalid('12345678901', 'eos'); + invalid('12345678901@', 'eos'); + }); + + }); + + it('should return true for correct monero addresses', function () { + valid('47zQ5LAivg6hNCgijXSEFVLX7mke1bgM6YGLFaANDoJbgXDymcAAZvvMNt2PmMpqEe5qRy2zyfMYXdwpmdyitiFh84xnPG2', 'monero'); + valid('48bWuoDG75CXMDHbmPEvUF2hm1vLDic7ZJ7hqRkL65QR9p13AQAX4eEACXNk4YP115Q4KRVZnAvmMBHrcGfv9FvKPZnH6vH', 'XMR'); + valid('A2be3UvzMtkJtxRYgcCbQt2y7Rp2eLVGqNTWfZeankrWimSMM4y7uMP6B9oAZaHsXTj8KFSerkSkkVRuEuEca9QM8VhxCNU', 'monero', 'testnet'); + + //integrated addresses + valid('4Gd4DLiXzBmbVX2FZZ3Cvu6fUaWACup1qDowprUCje1kSP4FmbftiJMSfV8kWZXNqmVwj4m52xqtgFNUudVmsmGkGvkLcCibWfVUfUFVB7', 'monero'); + valid('4J5sF94AzXgFgx8LuWc9dcWkJkGkD3cL3L2AuhX6QA9jFvSxxj6QhHqHXqM2b2Go7G8RyDzEbHxYd9G26XUUbuJChipEyBz9fENMU2Ua9b', 'XMR'); + + //stagenet public address + valid('5BAP9qLbRseYrGneYVRaFANMajuaD4KZrf3fGWvt5cVDR1xUXm6qoFYLkgU6Vp12fs2R24r4269inAWHFEdsLnE87rGCxYK', 'XMR', 'stagenet'); + + //stagenet integrated address + valid('5Ls4AeA639AYrGneYVRaFANMajuaD4KZrf3fGWvt5cVDR1xUXm6qoFYLkgU6Vp12fs2R24r4269inAWHFEdsLnE8BCU5Q2gDkbq2HYDrn2', 'monero', 'both'); + }); + + it('should return true for correct gamecredits addresses', function () { + valid('GU5BBtW9gxSKvAknvFi9yUaXKUNW9zUN2p', 'game'); + valid('GYxQMVzP6YpzX59QNRYqmJeHNtUMYSZPri', 'game'); + }); + + it('should return true for correct monacoin addresses', function () { + valid('MMN1Q1aRVUzanmg9DJjcRYzQSJQoBeQPui', 'mona'); + valid('PFMzNYnBm5X4c9qJkJPkfgdCyd9fuuy2vT', 'mona'); + valid('PCtN7VUYHW8w4g59BaphrfPs8g7pNgAzxn', 'mona'); + valid('MXCcYFGRmsd4d3CcQugFiqG8uarj5tVu76', 'mona'); + valid('MNK1pGsBf9WdoE54fZM9VFhkeYHW6VUf2u', 'mona'); + }); + + it('should return true for correct pivx addresses', function () { + valid('DJXFW9oJJBUX7QKrG6GKvmTs63MYKzwtpZ', 'pivx'); + valid('DEaYb8EHQgyKvX6VXDS3DZQautJrHBmK3T', 'pivx'); + valid('DDeCGR3QSgqsBxVR23bJvteiyYE34ZmxAc', 'pivx'); + valid('DSqQM8DPpBHHoZXHgRdwmaf6hZPEoZcFkh', 'pivx'); + }); + + it('should return true for correct solarcoin addresses', function () { + valid('8VxVLzwB26E2YZZ82o1NcQe96QSM2z6GwW', 'slr'); + valid('8YW5qcTjeyqX5kESsqu2BUdXiedgssegtQ', 'SolarCoin'); + }); + + it('should return true for correct tether addresses', function () { + valid('3MbYQMMmSkC3AgWkj9FMo5LsPTW1zBTwXL', 'usdt'); + valid('1KdXaqcBeoMAFVAPwTmYvDbEq6RnvNPF6J', 'tether'); + }); + + it('should return true for correct expanse addresses', function () { + valid('0xbab463743603a253bdf1f84975b1a9517505ae05', 'exp'); + valid('0x5d0777cb5d6977873904864c6ab531f4b3261f0b', 'expanse'); + }); + + it('should return true for correct waves addresses', function () { + valid('3P93mVrYnQ4ahaRMYwA2BeWY32eDxTpLVEs', 'waves'); + valid('3P4eeU7v1LMHQFwwT2GW9W99c6vZyytHajj', 'waves'); + + valid('3Myrq5QDgRq3nBVRSSv9UYrP36xTtpJND5y', 'waves', 'testnet'); + valid('3My3KZgFQ3CrVHgz6vGRt8687sH4oAA1qp8', 'waves', 'testnet'); + }); + + it('should return true for correct nano addresses', function () { + valid('xrb_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3', 'nano'); + valid('xrb_13ezf4od79h1tgj9aiu4djzcmmguendtjfuhwfukhuucboua8cpoihmh8byo', 'nano'); + valid('xrb_35jjmmmh81kydepzeuf9oec8hzkay7msr6yxagzxpcht7thwa5bus5tomgz9', 'nano'); + valid('xrb_1111111111111111111111111111111111111111111111111111hifc8npp', 'nano'); + valid('xrb_1ipx847tk8o46pwxt5qjdbncjqcbwcc1rrmqnkztrfjy5k7z4imsrata9est', 'nano'); + valid('xrb_3wm37qz19zhei7nzscjcopbrbnnachs4p1gnwo5oroi3qonw6inwgoeuufdp', 'nano'); + valid('xrb_3arg3asgtigae3xckabaaewkx3bzsh7nwz7jkmjos79ihyaxwphhm6qgjps4', 'nano'); + valid('xrb_1f5e4w33ndqbkx4bw5jtp13kp5xghebfxcmw9hdt1f7goid1s4373w6tjmgu', 'nano'); + valid('xrb_1q79ahdr36uqn38p5tp5sqwkn73rnpj1k8obtuetdbjcx37d5gahhd1u9cuh', 'nano'); + valid('nano_1q79ahdr36uqn38p5tp5sqwkn73rnpj1k8obtuetdbjcx37d5gahhd1u9cuh', 'nano'); + }); + + it('should return true for correct siacoin addresses', function () { + valid( + 'a9b01c85163638682b170d82de02b8bb99ba86092e9ab1b0d25111284fe618e93456915820f1', + 'siacoin' + ) + valid( + 'a9b01c85163638682b170d82de02b8bb99ba86092e9ab1b0d25111284fe618e93456915820f1', + 'siacoin' + ) + valid( + 'ab0c327982abfcc6055a6c9551589167d8a73501aca8769f106371fbc937ad100c955c3b7ba9', + 'siacoin' + ) + valid( + 'ffe1308c044ade30392a0cdc1fd5a4dbe94f9616a95faf888ed36123d9e711557aa497530373', + 'siacoin' + ) + }) + + it('should return true for correct loki addresses', function () { + // public + valid( + 'L63ymg8cb5aRz1PhXrEQ22PWw9KBhBS8rMsgqbABhTGFfh53U3Rc2iWCJpCPsHZT5hfyt7fPQa612a5Z1tBnGYEA9h6YHnn', + 'loki' + ) + valid( + 'L5QKRGMNpQU3eCAdjMVTCR631bRKqnW1oEWWBEHAtFJLieA5VvuxyyubCd9FczEEatg8jfy39UJZ13npLJqZG6dtMtM99ha', + 'loki' + ) + // integrated + valid( + 'LK8CGQ17G9R3ys3Xf33wCeViD2B95jgdpjAhcRsjuheJ784dumXn7g3RPAzedWpFq364jJKYL9dkQ8mY66sZG9BiD1xbPb6dpYo7toNRqk', + 'loki' + ) + valid( + 'LK8CGQ17G9R3ys3Xf33wCeViD2B95jgdpjAhcRsjuheJ784dumXn7g3RPAzedWpFq364jJKYL9dkQ8mY66sZG9BiCtWq1AYo1oJTVqgUcQ', + 'loki' + ) + // subaddress + valid( + 'LW1VMYcvWPZZJ2h1pKGEku2y9WeDiAU2VhgrgVgvjybaRuCdcEkg6FhXjVNSd37Bp7fhYH8tVa5T9VmRaYiWyxYdCpEGBg8', + 'loki' + ) + }) + + it('should return true for correct lbry addresses', function () { + valid('bNEMVqeUZUqTrYUxud5ehnUhtTAiWDXQ5e', 'lbc') + valid('bDb6NmobyDVeNGpizWQQBZkYjKCRQBdKdG', 'LBC') + valid('bTFXPcV3a8iVDezogvHTHezWZ1mZGWpPDc', 'lbc') + valid('bK2uEVn6UuwjCTUZ1Dfj5HhWYi9BtqZDDm', 'LBRY Credits') + }) + + it('should return true for correct trx addresses', function () { + valid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r', 'trx'); + valid('27bLJCYjbH6MT8DBF9xcrK6yZnm43vx7MNQ', 'trx', 'testnet'); + }); + + it('should return true for correct nem addresses', function () { + valid('NBZMQO7ZPBYNBDUR7F75MAKA2S3DHDCIFG775N3D', 'xem'); + valid('TDWTRGT6GVWCV7GRWFNI45S53PGOJBKNUF3GE6PB', 'xem', 'testnet'); + }); + + it('should return true for correct lsk addresses', function () { + valid('469226551L', 'lsk'); + valid('15823701926930889868L', 'lsk'); + valid('1657699692452120239L', 'lsk'); + valid('555666666999992L', 'lsk'); + valid('6853061742992593192L', 'lsk'); + valid('530464791801L', 'lsk'); + }); + + it('should return true for correct bsv addresses', function () { + valid('qzwryn9fxnpqkf7zt878tp2g9cg8kpl65qh2ml0w0r', 'bsv'); + valid('qp65yngy5uds4wxtrkynptal4f76qzmrh52pa3mpaf', 'bsv'); + valid('bitcoincash:qq4v32mtagxac29my6gwj6fd4tmqg8rysu23dax807', 'bsv'); + valid('qq4v32mtagxac29my6gwj6fd4tmqg8rysu23dax807', 'bsv'); + valid('qz97s7ee0rvwlymtxrwafmvs87x6027jwuf3wepug7', 'bsv'); + valid('bitcoincash:qpp32ssez340wfspnt79h6c4xds4fzf3m5j0cplx0l', 'bsv'); + valid('qqg82u7tq2eahs3gkh9m6kjnmjehr69m5v37alepq4', 'bsv'); + valid('bitcoincash:qrwkk9a3es2wu7mdvzh0vekfvjuzysq8tv7r3hcwr5', 'bsv'); + valid('1DrNXqCj2B8FKyx66RAWDkiEJhw2yrvhT3', 'bsv'); + }); + + it('should return true for correct stellar addresses', function () { + valid('GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', 'stellar'); + valid('GB7KKHHVYLDIZEKYJPAJUOTBE5E3NJAXPSDZK7O6O44WR3EBRO5HRPVT', 'stellar'); + valid('GD6WVYRVID442Y4JVWFWKWCZKB45UGHJAABBJRS22TUSTWGJYXIUR7N2', 'stellar'); + valid('GBCG42WTVWPO4Q6OZCYI3D6ZSTFSJIXIS6INCIUF23L6VN3ADE4337AP', 'stellar'); + valid('GDFX463YPLCO2EY7NGFMI7SXWWDQAMASGYZXCG2LATOF3PP5NQIUKBPT', 'stellar'); + valid('GBXEODUMM3SJ3QSX2VYUWFU3NRP7BQRC2ERWS7E2LZXDJXL2N66ZQ5PT', 'stellar'); + valid('GAJHORKJKDDEPYCD6URDFODV7CVLJ5AAOJKR6PG2VQOLWFQOF3X7XLOG', 'stellar'); + valid('GACXQEAXYBEZLBMQ2XETOBRO4P66FZAJENDHOQRYPUIXZIIXLKMZEXBJ', 'stellar'); + valid('GDD3XRXU3G4DXHVRUDH7LJM4CD4PDZTVP4QHOO4Q6DELKXUATR657OZV', 'stellar'); + valid('GDTYVCTAUQVPKEDZIBWEJGKBQHB4UGGXI2SXXUEW7LXMD4B7MK37CWLJ', 'stellar'); + }); +}); + +describe('invalid results', function () { + function commonTests(currency) { + invalid('', currency); //reject blank + invalid('%%@', currency); //reject invalid base58 string + invalid('1A1zP1ePQGefi2DMPTifTL5SLmv7DivfNa', currency); //reject invalid address + invalid('bd839e4f6fadb293ba580df5dea7814399989983', currency); //reject transaction id's + //testnet + invalid('', currency, 'testnet'); //reject blank + invalid('%%@', currency, 'testnet'); //reject invalid base58 string + invalid('1A1zP1ePQGefi2DMPTifTL5SLmv7DivfNa', currency, 'testnet'); //reject invalid address + invalid('bd839e4f6fadb293ba580df5dea7814399989983', currency, 'testnet'); //reject transaction id's + } + + it('should return false for incorrect bitcoin addresses', function () { + commonTests('bitcoin'); + }); + + it('should return false for incorrect bitcoincash addresses', function () { + commonTests('bitcoincash'); + }); + + it('should return false for incorrect litecoin addresses', function () { + commonTests('litecoin'); + }); + + it('should return false for incorrect peercoin addresses', function () { + commonTests('peercoin'); + }); + + it('should return false for incorrect dogecoin addresses', function () { + commonTests('dogecoin'); + }); + + it('should return false for incorrect beavercoin addresses', function () { + commonTests('beavercoin'); + }); + + it('should return false for incorrect freicoin addresses', function () { + commonTests('freicoin'); + }); + + it('should return false for incorrect protoshares addresses', function () { + commonTests('protoshares'); + }); + + it('should return false for incorrect megacoin addresses', function () { + commonTests('megacoin'); + }); + + it('should return false for incorrect primecoin addresses', function () { + commonTests('primecoin'); + }); + + it('should return false for incorrect auroracoin addresses', function () { + commonTests('auroracoin'); + }); + + it('should return false for incorrect namecoin addresses', function () { + commonTests('namecoin'); + }); + + it('should return false for incorrect biocoin addresses', function () { + commonTests('biocoin'); + }); + + it('should return false for incorrect garlicoin addresses', function () { + commonTests('garlicoin'); + }); + + it('should return false for incorrect vertcoin addresses', function () { + commonTests('vertcoin'); + }); + + it('should return false for incorrect bitcoingold addresses', function () { + commonTests('bitcoingold'); + }); + + it('should return false for incorrect decred addresses', function () { + commonTests('decred'); + }); + + it('should return false for incorrect gamecredits addresses', function () { + commonTests('game'); + }); + + it('should return false for incorrect monacoin addresses', function () { + commonTests('mona'); + }); + + it('should return false for incorrect solarcoin addresses', function () { + commonTests('slr'); + }); + + it('should return false for incorrect tether addresses', function () { + commonTests('usdt'); + }); + + it('should return false for incorrect expanse addresses', function () { + commonTests('exp'); + }); + + it('should return false for incorrect usdt addresses', function () { + commonTests('usdt'); + }); + + it('should return false for incorrect bankex addresses', function () { + invalid('1SQHtwR5oJRKLfiWQ2APsAd9miUc4k2ez', 'bankex'); + invalid('116CGDLddrZhMrTwhCVJXtXQpxygTT1kHd', 'BKX'); + invalid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'bankex', 'testnet'); + invalid('mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef', 'BKX', 'testnet'); + }); + + it('should return false for incorrect digibyte addresses', function () { + commonTests('digibyte'); + }); + + it('should return false for incorrect eip55 addresses', function () { + invalid('6xAff4d6793F584a473348EbA058deb8caad77a288', 'ethereum'); + invalid('0x02fcd51aAbB814FfFe17908fbc888A8975D839A5', 'ethereum'); + invalid('0XD1220A0CF47C7B9BE7A2E6BA89F429762E7B9ADB', 'ethereum'); + invalid('aFf4d6793f584a473348ebA058deb8caad77a2885', 'ethereum'); + invalid('0xff4d6793F584a473', 'ethereum'); + + invalid('0x02fcd51aAbB814FfFe17908fbc888A8975D839A5', 'ethereumclassic'); + invalid('0x02fcd51aAbB814FfFe17908fbc888A8975D839A5', 'etherzero'); + invalid('0x02fcd51aAbB814FfFe17908fbc888A8975D839A5', 'callisto'); + }); + + it('should return false for incorrect ripple addresses', function () { + invalid('rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCN', 'ripple'); + invalid('rDTXLQ7ZKZVKz33zJbHjgVShjsBnqMBhMN', 'XRP'); + invalid('6xAff4d6793F584a473348EbA058deb8ca', 'ripple'); + invalid('DJ53hTyLBdZp2wMi5BsCS3rtEL1ioYUkva', 'ripple'); + }); + + it('should return false for incorrect dash addresses', function () { + commonTests('dash'); + }); + + it('should return false for incorrect neo addresses', function () { + commonTests('neo'); + invalid('AR4QmqYENiZAD6oXe7ftm6eDcwtHk7rVTa', 'neo'); + invalid('AKDVzYGLczmykdtRaejgvWeZrvdkVEvQ10', 'NEO'); + }); + + it('should return false for incorrect qtum addresses', function () { + commonTests('qtum'); + invalid('QNPhBbVhDghASxcUh2vHotQUgNeLRFTcfb', 'qtum'); + invalid('QOPhBbVhDghASxcUh2vHotQUgNeLRFTcfa', 'QTUM'); + }); + + it('should return false for incorrect votecoin addresses', function () { + commonTests('votecoin'); + invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'votecoin'); + invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'VOT'); + invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'votecoin', 'testnet'); + }); + + it('should return false for incorrect bitcoinz addresses', function () { + commonTests('bitcoinz'); + invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'bitcoinz'); + invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'BTCZ'); + invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'bitcoinz', 'testnet'); + }); + + it('should return false for incorrect zclassic addresses', function () { + commonTests('zclassic'); + invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'zclassic'); + invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'ZCL'); + invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'zclassic', 'testnet'); + }); + + it('should return false for incorrect hush addresses', function () { + invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'hush'); + invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'HUSH'); + invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'hush', 'testnet'); + }); + + it('should return false for incorrect zcash addresses', function () { + commonTests('zcash'); + invalid('t1Y9yhDa5XEjgfnTgZoKddeSiEN1aoLkQxq', 'zcash'); + invalid('t3Yz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd', 'ZEC'); + invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'zcash', 'testnet'); + }); + + it('should return false for incorrect bitcoinprivate addresses', function () { + commonTests('bitcoinprivate'); + invalid('b1Y4XXPFhwMb1SP33yhzn3h9qWXjujkgep4', 'bitcoinprivate'); + //invalid('bx....', 'BTCP'); + //invalid('nx....', 'bitcoinprivate', 'testnet'); + }); + + it('should return false for incorrect snowgem addresses', function () { + commonTests('snowgem'); + invalid('s1Yx7WBkjB4UH6qQjPp6Ysmtr1C1JiTK2Yw', 'snowgem'); + invalid('s3Y27MhkBRt3ha2UuxhjXaYF4DCnttTMnL1', 'SNG'); + invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'snowgem', 'testnet'); + }); + + it('should return false for incorrect zencash addresses', function () { + commonTests('zencash'); + invalid('znYiGGfYRepxkBjXYvA2kFrXiC351i9ta4z', 'zencash'); + invalid('zsYEdGnZCQ9G86LZFtbynMn1hYTVhn6eYCL', 'ZEN'); + invalid('ztYWMDLWjbruCJxKmmfAZiT6QAQdiv5F291', 'zencash', 'testnet'); + }); + + it('should return false for incorrect komodo addresses', function () { + commonTests('komodo'); + invalid('R9Y5HirAzqDcWrWGiJEL115dpV3QB3hobH', 'komodo'); + invalid('RAYj2KKVUohTu3hVdNJ4U6hQi7TNawpacH', 'KMD'); + //invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'komodo', 'testnet'); + }); + + it('should return false for incorrect cardano addresses', function () { + commonTests('cardano'); + invalid('Ae2tdPwUPEYxYNJw1He1esdZYvjmr4NtPzUsGTiqL9zd8ohjZYQcwu6lom7', 'cardano'); + invalid('DdzFFzCqrhsfdzUZxvuBkhV8Lpm9p43p9ubh79GCTkxJikAjKh51qhtCFMqUniC5tv5ZExyvSmAte2Du2tGimavSo6qSgXbjiy8qZRTg1', 'cardano'); + invalid('DdzFFzCqrhsfdzUZxvuBkhV8Lpm9p43p9ubh79GCTkxJikAjKh51qhtCFMqUniC5tv5ZExyvSmAte2Du2tGimavSo6qSgXbjiy8qZRT', 'ada'); + //invalid('t2YNzUUx8mWBCRYPRezvA363EYXyEpHokyi', 'komodo', 'testnet'); + }); + + it('should return false for incorrect monero addresses', function () { + commonTests('monero'); + invalid('4AWygwA3hHNE4e4Yr9PtRWJiorXTjZkCi57g4ExYzfXDFFQ8DRFEFyui1dLqVknpqQjGUBdTMbgaFAZaDbrVHdk3GAKBZ3E', 'monero'); + invalid('44643dtxcxjgMWEQLo6mh1c4d9Zxx9GbgK9hEj9iGSiFEryCkbwHyJ3JqxZJRqeC3Hb7ZBLKq5NkaJwR1x95EYnR1bTgN6d', 'xmr'); + invalid('A17N9ztrxjQD3v3JJtHGvHVnq6BAbujDNEuensB6PFwBYFpkjAicih8hDtX76HBuEag5NeaCuMZmRMe6eE5NMRGxFTQn8nJ', 'monero', 'testnet'); + + //integrated + invalid('4LNSCKNSTPNbJYkyAEgL966eHJHLDHiq1PpwKoiFBybcSqNGYfLBJApC62uQEeGAFxfYEd29uXBBrJFo7DhKqFVNi3GhmN79EtD5dgycYz', 'monero'); + invalid('4JpzTwf3i1GeCV76beVr19179oa8j1L8xNSC1bXMtAxxdf4aTTLqubL8EvXfQmUGKt9MMigFtKy91VtoTTSfg1LU7LocPruT6KcGC9RKJV', 'xmr'); + }); + + it('should return false for incorrect waves addresses', function () { + commonTests('waves'); + invalid('3P93mVrYnQ4ahaRMYwA2BeWY32eDxTpLVEs1', 'waves'); + invalid('3P4eeU7v1LMHQFwwT2GW9W99c6vZyytHaj', 'waves'); + invalid('2P93mVrYnQ4ahaRMYwA2BeWY32eDxTpLVEs', 'waves'); + + invalid('3Myrq5QDgRq3nBVRSSv9UYRP36xTtpJND5y', 'waves', 'testnet'); + invalid('3My3KZgFQ3CrVHgz6vGRt8787sH4oAA1qp8', 'waves', 'testnet'); + }); + + it('should return false for incorrect nano addresses', function () { + commonTests('nano'); + invalid('xrb_1f5e4w33ndqbkx4bw5jtp13kp5xghebfxcmw9hdt1f7goid1s4373w6tjdgu', 'nano'); + invalid('nano_1f5e4w33ndqbkx4bw5jtp13kp5xghebfxcmw9hdt1f7goid1s4373w6tjdgu', 'nano'); + invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'nano'); + invalid('nano_111111111111111111111111111111111111111111111111111hifc8npp', 'nano'); + }); + + it('should return false for incorrect siacoin addresses', function () { + commonTests('siacoin') + invalid( + 'ffe1308c044ade30392a0cdc1fd5a4dbe94f9616a95faf888ed36123d9e711557aa497530372', + 'siacoin' + ) + }) + + it('should return false for incorrect lbry addresses', function () { + commonTests('lbc') + invalid('ffe1308c044ade30392a0cdc1fd5a4dbe94f9616a95faf888ed36123d9e711557aa497530372') + }) + + it('should return false for incorrect tron addresses', function () { + commonTests('trx'); + invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'trx'); + invalid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg31', 'trx'); + }); + + it('should return false for incorrect nem addresses', function () { + commonTests('nem'); + invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'nem'); + invalid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg31', 'nem'); + + invalid('3Myrq5QDgRq3nBVRSSv9UYRP36xTtpJND5y', 'nem', 'testnet'); + invalid('3My3KZgFQ3CrVHgz6vGRt8787sH4oAA1qp8', 'nem', 'testnet'); + }); + //15823701926930889868L + it('should return false for incorrect lsk addresses', function () { + commonTests('lsk'); + invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'lsk'); + invalid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg31', 'lsk'); + + invalid('158237019269308898689L', 'lsk'); + invalid('158237A192B930C898689L', 'lsk'); + }); + + it('should return false for incorrect bsv addresses', function () { + commonTests('bsv'); + invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'bsv'); + invalid('TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg31', 'bsv'); + + invalid('158237019269308898689L', 'bsv'); + invalid('158237A192B930C898689L', 'bsv'); + invalid('bitcoin:qzpuefrpg3kl2ykQe52rxn96pd3Kp4qudywr5pyrsf', 'bsv'); + invalid('pzuefrpg3kl2ykqe52rxn96pd3kp4qudywr5py', 'bsv'); + invalid('rlt2c2wuxr644encp3as0hygtj9djrsaumku3cex5', 'bsv'); + invalid('qra607y4wnkmnpy3wcmrxmltzkrxywcq85c7watpdx09', 'bsv'); + }); + + it('should return false for incorrect stellar addresses', function () { + commonTests('stellar'); + invalid('SBGWKM3CD4IL47QN6X54N6Y33T3JDNVI6AIJ6CD5IM47HG3IG4O36XCU', 'stellar'); + invalid('GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL', 'stellar'); + invalid('GCFZB6L25D26RQFDWSSBDEYQ32JHLRMTT44ZYE3DZQUTYOL7WY43PLBG++', 'stellar'); + invalid('GADE5QJ2TY7S5ZB65Q43DFGWYWCPHIYDJ2326KZGAGBN7AE5UY6JVDRRA', 'stellar'); + invalid('GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2', 'stellar'); + invalid('GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2T', 'stellar'); + invalid('GDXIIZTKTLVYCBHURXL2UPMTYXOVNI7BRAEFQCP6EZCY4JLKY4VKFNLT', 'stellar'); + invalid('SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDY', 'stellar'); + invalid('gWRYUerEKuz53tstxEuR3NCkiQDcV4wzFHmvLnZmj7PUqxW2wt', 'stellar'); + invalid('g4VPBPrHZkfE8CsjuG2S4yBQNd455UWmk', 'stellar'); + }); }); diff --git a/yarn.lock b/yarn.lock index 6b902891..64650df7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@types/color-name@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" + integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== + JSONStream@^1.0.3: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -63,6 +68,11 @@ ansi-regex@^4.1.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -70,6 +80,14 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +ansi-styles@^4.0.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" + integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== + dependencies: + "@types/color-name" "^1.1.1" + color-convert "^2.0.1" + anymatch@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" @@ -148,10 +166,10 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -base-x@^3.0.7: - version "3.0.7" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.7.tgz#1c5a7fafe8f66b4114063e8da102799d4e7c408f" - integrity sha512-zAKJGuQPihXW22fkrfOclUUZXM2g92z5GzlSMHxhO6r6Qj+Nm0ccaGNBzDZojzwOMkpjAv4J0fOv1U4go+a4iw== +base-x@^3.0.8: + version "3.0.8" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.8.tgz#1e1106c2537f0162e8b52474a557ebb09000018d" + integrity sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA== dependencies: safe-buffer "^5.0.1" @@ -187,11 +205,6 @@ blob@0.0.4: resolved "http://registry.npmjs.org/blob/-/blob-0.0.4.tgz#bcf13052ca54463f30f9fc7e95b9a47630a94921" integrity sha1-vPEwUspURj8w+fx+lbmkdjCpSSE= -bluebird@^3.3.0: - version "3.5.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.2.tgz#1be0908e054a751754549c270489c1505d4ab15a" - integrity sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg== - bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" @@ -321,17 +334,17 @@ browserify-zlib@~0.2.0: dependencies: pako "~1.0.5" -browserify@^16.5.0: - version "16.5.0" - resolved "https://registry.yarnpkg.com/browserify/-/browserify-16.5.0.tgz#a1c2bc0431bec11fd29151941582e3f645ede881" - integrity sha512-6bfI3cl76YLAnCZ75AGu/XPOsqUhRyc0F/olGIJeCxtfxF2HvPKEcmjU9M8oAPxl4uBY1U7Nry33Q6koV3f2iw== +browserify@^16.5.1: + version "16.5.1" + resolved "https://registry.yarnpkg.com/browserify/-/browserify-16.5.1.tgz#3c13c97436802930d5c3ae28658ddc33bfd37dc2" + integrity sha512-EQX0h59Pp+0GtSRb5rL6OTfrttlzv+uyaUVlK6GX3w11SQ0jKPKyjC/54RhPR2ib2KmfcELM06e8FxcI5XNU2A== dependencies: JSONStream "^1.0.3" assert "^1.4.0" browser-pack "^6.0.1" browser-resolve "^1.11.0" browserify-zlib "~0.2.0" - buffer "^5.0.2" + buffer "~5.2.1" cached-path-relative "^1.0.0" concat-stream "^1.6.0" console-browserify "^1.1.0" @@ -349,7 +362,7 @@ browserify@^16.5.0: inherits "~2.0.1" insert-module-globals "^7.0.0" labeled-stream-splicer "^2.0.0" - mkdirp "^0.5.0" + mkdirp-classic "^0.5.2" module-deps "^6.0.0" os-browserify "~0.3.0" parents "^1.0.1" @@ -375,24 +388,6 @@ browserify@^16.5.0: vm-browserify "^1.0.0" xtend "^4.0.0" -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= - buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" @@ -403,7 +398,7 @@ buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= -buffer@^5.0.2, buffer@^5.1.0: +buffer@^5.1.0, buffer@~5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg== @@ -453,7 +448,7 @@ chai@^4.2.0: pathval "^1.1.0" type-detect "^4.0.5" -chalk@^2.0.1: +chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -514,6 +509,15 @@ cliui@^5.0.0: strip-ansi "^5.2.0" wrap-ansi "^5.1.0" +cliui@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" + integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^6.2.0" + color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -521,11 +525,23 @@ color-convert@^1.9.0: dependencies: color-name "1.1.3" +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + colors@^1.1.0: version "1.3.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.2.tgz#2df8ff573dfbf255af562f8ce7181d6b971a359b" @@ -836,6 +852,11 @@ emoji-regex@^7.0.1: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + encodeurl@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -972,6 +993,14 @@ find-up@3.0.0, find-up@^3.0.0: dependencies: locate-path "^3.0.0" +find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + flat@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.0.tgz#090bec8b05e39cba309747f1d588f04dbaf98db2" @@ -1247,6 +1276,11 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" @@ -1288,12 +1322,10 @@ isarray@~1.0.0: resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= -isbinaryfile@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.3.tgz#5d6def3edebf6e8ca8cae9c30183a804b5f8be80" - integrity sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw== - dependencies: - buffer-alloc "^1.2.0" +isbinaryfile@^4.0.2: + version "4.0.6" + resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.6.tgz#edcb62b224e2b4710830b67498c8e4e5a4d2610b" + integrity sha512-ORrEy+SNVqUhrCaal4hA4fBzhggQQ+BaLntyPOdoEiwlKZW9BZiJXjg3RMiruE4tPEI3pyVPpySHQF/dKWperg== isexe@^2.0.0: version "2.0.0" @@ -1332,10 +1364,10 @@ jsonparse@^1.2.0: resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= -jssha@2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/jssha/-/jssha-2.3.1.tgz#147b2125369035ca4b2f7d210dc539f009b3de9a" - integrity sha1-FHshJTaQNcpLL30hDcU58Amz3po= +jssha@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/jssha/-/jssha-2.4.2.tgz#d950b095634928bd6b2bda1d42da9a3a762d65e9" + integrity sha512-/jsi/9C0S70zfkT/4UlKQa5E1xKurDnXcQizcww9JSR/Fv+uIbWM2btG+bFcL3iNoK9jIGS0ls9HWLr1iw0kFg== karma-chai@^0.1.0: version "0.1.0" @@ -1349,19 +1381,18 @@ karma-chrome-launcher@^3.1.0: dependencies: which "^1.2.1" -karma-mocha@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/karma-mocha/-/karma-mocha-1.3.0.tgz#eeaac7ffc0e201eb63c467440d2b69c7cf3778bf" - integrity sha1-7qrH/8DiAetjxGdEDStpx883eL8= +karma-mocha@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/karma-mocha/-/karma-mocha-2.0.0.tgz#ad6b56b6a72e9b191e4c432dd30f4a44fc2435bc" + integrity sha512-qiZkZDJnn2kb9t2m4LoM4cYJHJVPoxvAYYe0B+go5s+A/3vc/3psUT05zW4yFz4vT0xHf+XzTTery8zdr8GWgA== dependencies: - minimist "1.2.0" + minimist "^1.2.3" -karma@^4.4.1: - version "4.4.1" - resolved "https://registry.yarnpkg.com/karma/-/karma-4.4.1.tgz#6d9aaab037a31136dc074002620ee11e8c2e32ab" - integrity sha512-L5SIaXEYqzrh6b1wqYC42tNsFMx2PWuxky84pK9coK09MvmL7mxii3G3bZBh/0rvD27lqDd0le9jyhzvwif73A== +karma@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/karma/-/karma-5.0.2.tgz#e404373dac6e3fa08409ae4d9eda7d83adb43ee5" + integrity sha512-RpUuCuGJfN3WnjYPGIH+VBF8023Lfm3TQH6D1kcNL+FxtEPc2UUz/nVjbVAGXH4Pm+Q7FVOAQjdAeFUpXpQ3IA== dependencies: - bluebird "^3.3.0" body-parser "^1.16.1" braces "^3.0.2" chokidar "^3.0.0" @@ -1373,20 +1404,19 @@ karma@^4.4.1: glob "^7.1.1" graceful-fs "^4.1.2" http-proxy "^1.13.0" - isbinaryfile "^3.0.0" + isbinaryfile "^4.0.2" lodash "^4.17.14" log4js "^4.0.0" mime "^2.3.1" minimatch "^3.0.2" - optimist "^0.6.1" qjobs "^1.1.4" range-parser "^1.2.0" rimraf "^2.6.0" - safe-buffer "^5.0.1" socket.io "2.1.1" source-map "^0.6.1" tmp "0.0.33" - useragent "2.3.0" + ua-parser-js "0.7.21" + yargs "^15.3.1" labeled-stream-splicer@^2.0.0: version "2.0.1" @@ -1405,6 +1435,18 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= + lodash.memoize@~3.0.3: version "3.0.4" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" @@ -1415,12 +1457,12 @@ lodash@^4.17.14, lodash@^4.17.15: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== -log-symbols@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== +log-symbols@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" + integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== dependencies: - chalk "^2.0.1" + chalk "^2.4.2" log4js@^4.0.0: version "4.5.1" @@ -1433,14 +1475,6 @@ log4js@^4.0.0: rfdc "^1.1.4" streamroller "^1.0.6" -lru-cache@4.1.x: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -1497,32 +1531,32 @@ minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@0.0.8: - version "0.0.8" - resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1: +minimist@^1.1.0, minimist@^1.1.1: version "1.2.0" resolved "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= -minimist@~0.0.1: - version "0.0.10" - resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= +minimist@^1.2.3, minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +mkdirp-classic@^0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.2.tgz#54c441ce4c96cd7790e10b41a87aa51068ecab2b" + integrity sha512-ejdnDQcR75gwknmMw/tx02AuRs8jCtqFoFqDZMjiNxsu85sRIJVXDKHuLYvUUPRBUtV2FpSZa9bL1BUa3BdR2g== -mkdirp@0.5.1, mkdirp@^0.5.0: - version "0.5.1" - resolved "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= +mkdirp@0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.3.tgz#5a514b7179259287952881e94410ec5465659f8c" + integrity sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg== dependencies: - minimist "0.0.8" + minimist "^1.2.5" -mocha@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.0.0.tgz#c60d14bf3de9601f549b3ff5be657eb8381c54bf" - integrity sha512-CirsOPbO3jU86YKjjMzFLcXIb5YiGLUrjrXFHoJ3e2z9vWiaZVCZQ2+gtRGMPWF+nFhN6AWwLM/juzAQ6KRkbA== +mocha@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.1.1.tgz#89fbb30d09429845b1bb893a830bf5771049a441" + integrity sha512-3qQsu3ijNS3GkWcccT5Zw0hf/rWvu1fTN9sPvEd81hlwsr30GX2GcDSSoBxo24IR8FelmrAydGC6/1J5QQP4WA== dependencies: ansi-colors "3.2.3" browser-stdout "1.3.1" @@ -1535,9 +1569,9 @@ mocha@^7.0.0: growl "1.10.5" he "1.2.0" js-yaml "3.13.1" - log-symbols "2.2.0" + log-symbols "3.0.0" minimatch "3.0.4" - mkdirp "0.5.1" + mkdirp "0.5.3" ms "2.1.1" node-environment-flags "1.0.6" object.assign "4.1.0" @@ -1545,8 +1579,8 @@ mocha@^7.0.0: supports-color "6.0.0" which "1.3.1" wide-align "1.1.3" - yargs "13.3.0" - yargs-parser "13.1.1" + yargs "13.3.2" + yargs-parser "13.1.2" yargs-unparser "1.6.0" module-deps@^6.0.0: @@ -1640,14 +1674,6 @@ once@^1.3.0: dependencies: wrappy "1" -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - os-browserify@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" @@ -1665,6 +1691,13 @@ p-limit@^2.0.0: dependencies: p-try "^2.0.0" +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" @@ -1672,6 +1705,13 @@ p-locate@^3.0.0: dependencies: p-limit "^2.0.0" +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + p-try@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1" @@ -1729,6 +1769,11 @@ path-exists@^3.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -1775,11 +1820,6 @@ process@~0.11.0: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - public-encrypt@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" @@ -2131,6 +2171,15 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + string_decoder@^1.1.1, string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -2152,6 +2201,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + strip-json-comments@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -2205,7 +2261,7 @@ timers-browserify@^1.0.1: dependencies: process "~0.11.0" -tmp@0.0.33, tmp@0.0.x: +tmp@0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== @@ -2247,6 +2303,11 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= +ua-parser-js@0.7.21: + version "0.7.21" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777" + integrity sha512-+O8/qh/Qj8CgC6eYBVBykMrNtp5Gebn4dlGD/kKXVkJNDwyrAwSIqwz8CDf+tsAIWVycKcku6gIXJ0qwx/ZXaQ== + uglify-es@^3.3.9: version "3.3.9" resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677" @@ -2293,14 +2354,6 @@ url@~0.11.0: punycode "1.3.2" querystring "0.2.0" -useragent@2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972" - integrity sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw== - dependencies: - lru-cache "4.1.x" - tmp "0.0.x" - util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -2354,11 +2407,6 @@ wide-align@1.1.3: dependencies: string-width "^1.0.2 || 2" -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= - wrap-ansi@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" @@ -2368,6 +2416,15 @@ wrap-ansi@^5.1.0: string-width "^3.0.0" strip-ansi "^5.0.0" +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -2397,12 +2454,15 @@ y18n@^4.0.0: resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= +yargs-parser@13.1.2, yargs-parser@^13.1.2: + version "13.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" + integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" -yargs-parser@13.1.1, yargs-parser@^13.1.1: +yargs-parser@^13.1.1: version "13.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== @@ -2410,6 +2470,14 @@ yargs-parser@13.1.1, yargs-parser@^13.1.1: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^18.1.1: + version "18.1.3" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" + integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs-unparser@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" @@ -2419,7 +2487,23 @@ yargs-unparser@1.6.0: lodash "^4.17.15" yargs "^13.3.0" -yargs@13.3.0, yargs@^13.3.0: +yargs@13.3.2: + version "13.3.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" + integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.2" + +yargs@^13.3.0: version "13.3.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA== @@ -2435,6 +2519,23 @@ yargs@13.3.0, yargs@^13.3.0: y18n "^4.0.0" yargs-parser "^13.1.1" +yargs@^15.3.1: + version "15.3.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.3.1.tgz#9505b472763963e54afe60148ad27a330818e98b" + integrity sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA== + dependencies: + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^4.2.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^18.1.1" + yeast@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419"