Comparing version 0.3.0 to 0.3.1
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ifid=t():e.ifid=t()}(this,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}([function(e,t){},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}},function(e,t,r){e.exports=function(){var e=e||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},o=i.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},s=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var s=r[o>>>2]>>>24-o%4*8&255;t[n+o>>>2]|=s<<24-(n+o)%4*8}else for(var o=0;o<i;o+=4)t[n+o>>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){var t=t,r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},o=0;o<t;o+=4){var a=i(4294967296*(r||e.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new s.init(n,t)}}),a=n.enc={},c=a.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new s.init(r,t/2)}},u=a.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new s.init(r,t)}},f=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,a=4*o,c=i/a,u=(c=t?e.ceil(c):e.max((0|c)-this._minBufferSize,0))*o,f=e.min(4*u,i);if(u){for(var d=0;d<u;d+=o)this._doProcessBlock(n,d);var h=n.splice(0,u);r.sigBytes-=f}return new s.init(h,f)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),h=(i.Hasher=d.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){e&&this._append(e);var t=this._doFinalize();return t},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new h.HMAC.init(e,r).finalize(t)}}}),n.algo={});return n}(Math);return e}()},function(e,t){function r(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(e){return n.exec(e).slice(1)};function o(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}t.resolve=function(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var i=n>=0?arguments[n]:process.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(e=i+"/"+e,t="/"===i.charAt(0))}return e=r(o(e.split("/"),function(e){return!!e}),!t).join("/"),(t?"/":"")+e||"."},t.normalize=function(e){var n=t.isAbsolute(e),i="/"===s(e,-1);return(e=r(o(e.split("/"),function(e){return!!e}),!n).join("/"))||n||(e="."),e&&i&&(e+="/"),(n?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(o(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var i=n(e.split("/")),o=n(r.split("/")),s=Math.min(i.length,o.length),a=s,c=0;c<s;c++)if(i[c]!==o[c]){a=c;break}var u=[];for(c=a;c<i.length;c++)u.push("..");return(u=u.concat(o.slice(a))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=i(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},t.basename=function(e,t){var r=i(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){return i(e)[3]};var s="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}},function(e,t,r){e.exports=function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=r.Hasher,o=[],s=t.algo.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],a=r[3],c=r[4],u=0;u<80;u++){if(u<16)o[u]=0|e[t+u];else{var f=o[u-3]^o[u-8]^o[u-14]^o[u-16];o[u]=f<<1|f>>>31}var d=(n<<5|n>>>27)+c+o[u];d+=u<20?1518500249+(i&s|~i&a):u<40?1859775393+(i^s^a):u<60?(i&s|i&a|s&a)-1894007588:(i^s^a)-899497514,c=a,a=s,s=i<<30|i>>>2,i=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+s|0,r[3]=r[3]+a|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1}(r(2))},function(e,t,r){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,s=r.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=e[t+0],c=e[t+1],l=e[t+2],p=e[t+3],I=e[t+4],_=e[t+5],S=e[t+6],v=e[t+7],m=e[t+8],g=e[t+9],E=e[t+10],y=e[t+11],A=e[t+12],w=e[t+13],N=e[t+14],D=e[t+15],b=o[0],M=o[1],T=o[2],U=o[3];M=h(M=h(M=h(M=h(M=d(M=d(M=d(M=d(M=f(M=f(M=f(M=f(M=u(M=u(M=u(M=u(M,T=u(T,U=u(U,b=u(b,M,T,U,s,7,a[0]),M,T,c,12,a[1]),b,M,l,17,a[2]),U,b,p,22,a[3]),T=u(T,U=u(U,b=u(b,M,T,U,I,7,a[4]),M,T,_,12,a[5]),b,M,S,17,a[6]),U,b,v,22,a[7]),T=u(T,U=u(U,b=u(b,M,T,U,m,7,a[8]),M,T,g,12,a[9]),b,M,E,17,a[10]),U,b,y,22,a[11]),T=u(T,U=u(U,b=u(b,M,T,U,A,7,a[12]),M,T,w,12,a[13]),b,M,N,17,a[14]),U,b,D,22,a[15]),T=f(T,U=f(U,b=f(b,M,T,U,c,5,a[16]),M,T,S,9,a[17]),b,M,y,14,a[18]),U,b,s,20,a[19]),T=f(T,U=f(U,b=f(b,M,T,U,_,5,a[20]),M,T,E,9,a[21]),b,M,D,14,a[22]),U,b,I,20,a[23]),T=f(T,U=f(U,b=f(b,M,T,U,g,5,a[24]),M,T,N,9,a[25]),b,M,p,14,a[26]),U,b,m,20,a[27]),T=f(T,U=f(U,b=f(b,M,T,U,w,5,a[28]),M,T,l,9,a[29]),b,M,v,14,a[30]),U,b,A,20,a[31]),T=d(T,U=d(U,b=d(b,M,T,U,_,4,a[32]),M,T,m,11,a[33]),b,M,y,16,a[34]),U,b,N,23,a[35]),T=d(T,U=d(U,b=d(b,M,T,U,c,4,a[36]),M,T,I,11,a[37]),b,M,v,16,a[38]),U,b,E,23,a[39]),T=d(T,U=d(U,b=d(b,M,T,U,w,4,a[40]),M,T,s,11,a[41]),b,M,p,16,a[42]),U,b,S,23,a[43]),T=d(T,U=d(U,b=d(b,M,T,U,g,4,a[44]),M,T,A,11,a[45]),b,M,D,16,a[46]),U,b,l,23,a[47]),T=h(T,U=h(U,b=h(b,M,T,U,s,6,a[48]),M,T,v,10,a[49]),b,M,N,15,a[50]),U,b,_,21,a[51]),T=h(T,U=h(U,b=h(b,M,T,U,A,6,a[52]),M,T,p,10,a[53]),b,M,E,15,a[54]),U,b,c,21,a[55]),T=h(T,U=h(U,b=h(b,M,T,U,m,6,a[56]),M,T,D,10,a[57]),b,M,S,15,a[58]),U,b,w,21,a[59]),T=h(T,U=h(U,b=h(b,M,T,U,I,6,a[60]),M,T,y,10,a[61]),b,M,l,15,a[62]),U,b,g,21,a[63]),o[0]=o[0]+b|0,o[1]=o[1]+M|0,o[2]=o[2]+T|0,o[3]=o[3]+U|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var o=t.floor(n/4294967296),s=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,c=a.words,u=0;u<4;u++){var f=c[u];c[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,i,o,s){var a=e+(t&r|~t&n)+i+s;return(a<<o|a>>>32-o)+t}function f(e,t,r,n,i,o,s){var a=e+(t&n|r&~n)+i+s;return(a<<o|a>>>32-o)+t}function d(e,t,r,n,i,o,s){var a=e+(t^r^n)+i+s;return(a<<o|a>>>32-o)+t}function h(e,t,r,n,i,o,s){var a=e+(r^(t|~n))+i+s;return(a<<o|a>>>32-o)+t}r.MD5=o._createHelper(c),r.HmacMD5=o._createHmacHelper(c)}(Math),e.MD5}(r(2))},function(e,t,r){e.exports=function(e){return e.enc.Hex}(r(2))},function(e,t,r){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,s=r.algo,a=[],c=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)e(n)&&(i<8&&(a[i]=r(t.pow(n,.5))),c[i]=r(t.pow(n,1/3)),i++),n++}();var u=[],f=s.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],f=r[5],d=r[6],h=r[7],l=0;l<64;l++){if(l<16)u[l]=0|e[t+l];else{var p=u[l-15],I=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,_=u[l-2],S=(_<<15|_>>>17)^(_<<13|_>>>19)^_>>>10;u[l]=I+u[l-7]+S+u[l-16]}var v=n&i^n&o^i&o,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),g=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&f^~a&d)+c[l]+u[l];h=d,d=f,f=a,a=s+g|0,s=o,o=i,i=n,n=g+(m+v)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+f|0,r[6]=r[6]+d|0,r[7]=r[7]+h|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=o._createHelper(f),r.HmacSHA256=o._createHmacHelper(f)}(Math),e.SHA256}(r(2))},function(e,t,r){"use strict";r.r(t);var n={UUID_VERSION_INVALID:"The version argument was not a valid UUID version.",HASH_ARGUMENT_MISSING:"The hash argument was not provided, without which a v3 or v5 UUID cannot be created.",TIMESTAMP_GENERATION_FAILED:"The random number generator did not produce an acceptable value for the random number used in place of a stable timestamp.",TIMESTAMP_INVALID:"The timestamp property of the UUID object is malformed.",NAMESPACE_ID_MISSING:"In order to construct a v3 or v5 UUID, you need to provide a namespace ID to be hashed.",NAME_MISSING:"In order to construct a v3 or v5 UUID, you need to provide a name to be hashed.",CLOCK_SEQUENCE_INVALID:"The clockSequence property of the UUID object is malformed.",CLOCK_SEQUENCE_GENERATION_FAILED:"The random number generator did not produce an acceptable value for the random number used in place of a stable clock sequence.",CLOCK_SEQUENCE_LOW_INVALID:"The clockSequenceLow property of the UUID object is malformed.",CLOCK_SEQUENCE_HIGH_INVALID:"The clockSequenceHigh property of the UUID object is malformed.",CLOCK_HIGH_AND_RESERVED_INVALID:"The clockSequenceHighAndReserved property of the UUID object is malformed.",MAC_ADDRESS_UNAVAILABLE:"The MAC address is unavailable, which makes creating the version 1 node ID impossible.",MAC_ADDRESS_INVALID:"The MAC address was found, but it was malformed.",UUID_LAST_RESULTS_INVALID:"The provided last results object did not meet the isValidLastResults type guard.",UUID_STRING_INVALID:"The text argument passed to UUID.parse was malformed.",UUID_OPTIONS_INVALID:"The options argument passed to one of the UUID methods did not meet the isUUIDOptions type guard.",TIME_LOW_INVALID:"The timestamp property did not produce a valid low portion of the timestamp.",TIME_MID_INVALID:"The timestamp property did not produce a valid mid portion of the timestamp.",TIME_HIGH_INVALID:"The timestamp property did not produce a valid high portion of the timestamp.",TIME_HIGH_AND_VERSION_INVALID:"The timestamp property did not produce a valid high-and-version multiplex.",NODE_IDENTIFIER_INVALID:"The nodeIdentifier property of the UUID object was malformed."},i=r(4),o=r(5),s=r(6),a=function(e,t,r){if(!t)throw new Error(n.NAMESPACE_ID_MISSING);if(!r)throw new Error(n.NAME_MISSING);var a,c=t+r;return a="3"===e.toString()?o(c):i(c),s.stringify(a)},c=function(){return Boolean("undefined"!=typeof process&&process.versions&&process.versions.node)};function u(e){return/^[1345]$/.test(e.toString())}var f=function(e){return parseInt(function(e){return e.reduce(function(e,t){return e+t.toString(16)},"")}(e),16)},d=function(e){for(var t=[],r=e.length;r>0;r-=8){var n=e.slice(r-8,r).padStart(8,"0");t.unshift(parseInt(n,2))}return new Uint8Array(t)},h=r(0);function l(e){return"object"==typeof e&&e&&e.clockSequence&&"BYTES_PER_ELEMENT"in e.clockSequence&&e.nodeIdentifier&&"BYTES_PER_ELEMENT"in e.nodeIdentifier&&e.timestamp&&"BYTES_PER_ELEMENT"in e.timestamp}var p=r(1),I=r(3),_=function(){var e=null;try{var t=Object(h.readFileSync)(Object(I.join)(Object(p.homedir)(),"ifid"),"utf8");e=JSON.parse(t)}catch(e){}return l(e)?e:{}}(),S=function(e){if(c())return new Uint8Array(Object(h.randomBytes)(e));for(var t=window.crypto||window.msCrypto,r=new Uint8Array(e),n=0;n<e;n+=65536)t.getRandomValues(r.subarray(n,n+Math.min(e-n,65536)));return r};function v(e,t){if(!u(e))throw new Error(n.UUID_VERSION_INVALID);var r;if(/^[14]$/.test(e.toString())){if(_.clockSequence&&"BYTES_PER_ELEMENT"in _.clockSequence)return _.clockSequence;r=function(){var e=f(S(2)).toString(2).slice(0,14);return new Uint8Array([parseInt(e.slice(0,6),2),parseInt(e.slice(6),2)])}(),"1"===e.toString()&&(_.clockSequence=r)}else{if(!t)throw new Error(n.HASH_ARGUMENT_MISSING);var i="";i+=t.slice(16,18),i+=t.slice(18,20);var o=parseInt(i,16).toString(2).padStart(14,"0");r=d(o)}return r}function m(e,t){var r;if("1"===e.toString()){if(_.nodeIdentifier&&"BYTES_PER_ELEMENT"in _.nodeIdentifier)return _.nodeIdentifier;r=function(){for(var e=Object(p.networkInterfaces)(),t=Object.keys(e),r=0;r<t.length;r+=1)for(var i=e[t[r]],o=0;o<i.length;o+=1){var s=i[o];if("object"==typeof s&&s){var a=s.mac;if("string"==typeof a&&a&&"00:00:00:00:00:00"!==a){var c=a.split(":").map(function(e){return parseInt(e,16)});return new Uint8Array(c)}}}throw new Error(n.MAC_ADDRESS_UNAVAILABLE)}(),_.nodeIdentifier=r}else if(/^[35]$/.test(e.toString())){if(!t)throw new Error(n.HASH_ARGUMENT_MISSING);var i="";i+=t.slice(20,32);var o=parseInt(i,16).toString(2).padStart(48,"0");o=o.slice(0,7)+"1"+o.slice(8),r=d(o)}else{if("4"!==e.toString())throw new Error(n.UUID_VERSION_INVALID);r=S(6)}return r}function g(){return 10*((new Date).getTime()-new Date(1582,9,15).getTime())}function E(e,t){if(!u(e))throw new Error(n.UUID_VERSION_INVALID);var r;if("1"===e.toString()){var i=_.timestamp,o=g();i&&"BYTES_PER_ELEMENT"in i&&f(i)>o&&_.clockSequence&&"BYTES_PER_ELEMENT"in _.clockSequence&&(_.clockSequence[1]+=1,0===_.clockSequence[1]&&(_.clockSequence[0]+=1));for(var s=o.toString(2).padStart(60,"0"),a=[],c=60;c>0;c-=8){var h=s.slice(c-8,c).padStart(8,"0");a.unshift(parseInt(h,2))}r=new Uint8Array(a)}else if(/^[35]$/.test(e.toString())){if(!t)throw new Error(n.HASH_ARGUMENT_MISSING);var l="";l=t.slice(0,8),l=t.slice(8,12)+l,l=t.slice(12,16)+l;var p=parseInt(l,16).toString(2).padStart(60,"0");r=d(p)}else(r=S(8))[7]=parseInt(r[7].toString(2).slice(0,4),2);return _.timestamp=r,r}var y=function(e){void 0===e&&(e={}),this.version="4",this.clockSequenceGetter=v,this.nodeIdentifierGetter=m,this.timestampGetter=E;var t=e||{};if(t.version){if(!u(t.version))throw new Error(n.UUID_VERSION_INVALID);this.version=t.version}if(t.clockSequenceGetter&&(this.clockSequenceGetter=t.clockSequenceGetter),t.nodeIdentifierGetter&&(this.nodeIdentifierGetter=t.nodeIdentifierGetter),t.timestampGetter&&(this.timestampGetter=t.timestampGetter),t.namespaceId&&(this.namespaceId=t.namespaceId),t.name&&(this.namespaceId=t.namespaceId),/^[35]$/.test(this.version.toString())){if(!this.namespaceId)throw new Error(n.NAMESPACE_ID_MISSING);if(!this.name)throw new Error(n.NAME_MISSING)}},A=function(e){if(!l(e))throw new Error(n.UUID_LAST_RESULTS_INVALID);var t={clockSequence:Array.from(e.clockSequence),nodeIdentifier:Array.from(e.nodeIdentifier),timestamp:Array.from(e.timestamp)};try{Object(h.writeFileSync)(Object(I.join)(Object(p.homedir)(),"ifid"),JSON.stringify(t),{encoding:"utf8"})}catch(e){console.error("Could not save results.")}};function w(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var N,D=function(){function e(e){var t=new y;e&&"object"==typeof e&&(e.version&&(t.version=e.version),e.clockSequenceGetter&&(t.clockSequenceGetter=e.clockSequenceGetter),e.timestampGetter&&(t.timestampGetter=e.timestampGetter),e.nodeIdentifierGetter&&(t.nodeIdentifierGetter=e.nodeIdentifierGetter),e.namespaceId&&(t.namespaceId=e.namespaceId),e.name&&(t.name=e.name));var r=t.version;if(!u(r))throw new Error(n.UUID_VERSION_INVALID);if(c()||"1"===r.toString()&&(console.error("The time-based version 1 UUID cannot be created within the browser. Falling back to the pseudo-random version 4."),r="4"),this.__version=r,/^[35]$/.test(r.toString())){if(!t.namespaceId)throw new Error(n.NAMESPACE_ID_MISSING);if(!t.name)throw new Error(n.NAME_MISSING);var i=a(r,t.namespaceId,t.name),o=t.clockSequenceGetter(r,i);this.__clockSequence=o;var s=t.timestampGetter(r,i);this.__timestamp=s;var f=t.nodeIdentifierGetter(r,i);this.__nodeIdentifier=f}else{var d=t.clockSequenceGetter(r);this.__clockSequence=d;var h=t.timestampGetter(r);this.__timestamp=h;var l=t.nodeIdentifierGetter(r);this.__nodeIdentifier=l,c()&&"1"===this.version.toString()&&A(this)}}return e.parse=function(e){var t=e.split("-");if(5!==t.length)throw new Error(n.UUID_STRING_INVALID);for(var r=t[0],i=t[1],o=t[2],s=o.slice(0,3),a=o[4],c=s+i+r,u=[],f=0;f<16;f+=2)u.push(parseInt(c.slice(f,f+2),16));for(var d=new Uint8Array(u),h=t[3],l=h.slice(0,2),p=parseInt(parseInt(l,16).toString(2).slice(2),2).toString(16),I=h.slice(2,4)+p,_=[],S=0;S<7;S+=2)_.push(parseInt(I.slice(S,S+2),16));for(var v=new Uint8Array(_),m=t[4],g=[],E=0;E<12;E+=2)g.push(parseInt(m.slice(E,E+2),16));var y=new Uint8Array(g);return Object.assign({},this.prototype,{__version:a,__timestamp:d,__clockSequence:v,__nodeIdentifier:y})},e.prototype.toString=function(){var e=function(e,t){return f(e).toString(16).padStart(t,"0")};return e(this.timeLow,8)+"-"+e(this.timeMid,4)+"-"+e(this.timeHighAndVersion,4)+"-"+e(this.clockSequenceHighAndReserved,2)+e(this.clockSequenceLow,2)+"-"+e(this.nodeIdentifier,12)},function(e,t,r){t&&w(e.prototype,t)}(e,[{key:"version",get:function(){return this.__version}},{key:"timestamp",get:function(){return this.__timestamp}},{key:"timeLow",get:function(){return this.timestamp.slice(4,8)}},{key:"timeMid",get:function(){return this.timestamp.slice(2,4)}},{key:"timeHigh",get:function(){return this.timestamp.slice(0,2)}},{key:"timeHighAndVersion",get:function(){var e=this.timeHigh,t=parseInt(this.version.toString()).toString(2),r=f(e).toString(2),n=t.padStart(4,"0")+r.padStart(12,"0"),i=parseInt(n.slice(0,8),2),o=parseInt(n.slice(8,16),2);return new Uint8Array([i,o])}},{key:"clockSequence",get:function(){return this.__clockSequence}},{key:"clockSequenceLow",get:function(){return this.clockSequence.slice(0,1)}},{key:"clockSequenceHigh",get:function(){return this.clockSequence.slice(1)}},{key:"reserved",get:function(){return new Uint8Array([2])}},{key:"clockSequenceHighAndReserved",get:function(){var e=f(this.clockSequenceHigh).toString(2),t=f(this.reserved).toString(2),r=e.padStart(6,"0")+t.padStart(2,"0");return new Uint8Array([parseInt(r,2)])}},{key:"nodeIdentifier",get:function(){return this.__nodeIdentifier}}]),e}();!function(e){e.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",e.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",e.OID="6ba7b812-9dad-11d1-80b4-00c04fd430c8",e.X500="6ba7b814-9dad-11d1-80b4-00c04fd430c8"}(N||(N={})),r.d(t,"cryptoJs",function(){return U}),r.d(t,"UUID",function(){return D}),r.d(t,"UUIDOptions",function(){return y}),r.d(t,"NamespaceIds",function(){return N}),r.d(t,"clockSequenceGetter",function(){return v}),r.d(t,"getHashFromNamespaceIdAndName",function(){return a}),r.d(t,"getHundredsOfNanosecondsSinceGregorianReform",function(){return g}),r.d(t,"nodeIdentifierGetter",function(){return m}),r.d(t,"timestampGetter",function(){return E}),r.d(t,"uintArrayAsNumber",function(){return f});var b=r(4),M=r(7),T=r(5),U={hex:r(6),MD5:T,SHA1:b,SHA256:M}}])},function(e,t,r){"use strict";var n;r.r(t),function(e){e.v1_0="00000",e.v1_18="01800",e.v1_19="01900",e.v1_20="02000",e.v1_32_COS="03200",e.v1_35="03500",e.v1_5H="05000",e.v1_5F="05050",e.v1_6="05070",e.v1_82="08200",e.v1_83="08300",e.ME_1_0="10000",e.ME_1_5="15000",e.ME_1_6="16000",e.Magx_0_0="20000"}(n||(n={}));var i;!function(e){e.UUID="UUIDv4",e.UUIDv1="UUIDv1",e.UUIDv4="UUIDv4",e.FileBased="FileBasedSHA",e.FileBasedSHA="FileBasedSHA",e.FileBasedMD5="FileBasedMD5",e.Pre1990ZCode="Pre1990ZCode",e.Post1990ZCode="Post1990ZCode",e.LegacyTADS2="TADS2",e.LegacyTADS3="TADS3",e.LegacyHugo="HUGO",e.DocumentedMagneticScrolls="DocumentedMagneticScrolls",e.UndocumentedMagneticScrolls="MAGNETIC",e.LegacyAGT="LegacyAGT",e.LegacyAdvSys="ADVSYS",e.MSDOS="MZ",e.Windows="MZ",e.OS2="MZ",e.ELF="ELF",e.Java="JAVA",e.AmigaOS="AMIGA",e.Script="SCRIPT",e.MacOSX="MACHO",e.MachO="MACHO",e.PreOSX="MAC",e.ALAN="ALAN"}(i||(i={}));var o;!function(e){e.ThePawn="The Pawn",e.GuildOfThieves="Guild of Thieves",e.Jinxter="Jinxter",e.Corruption="Corruption",e.Fish="Fish!",e.Myth="Myth",e.Wonderland="Wonderland"}(o||(o={}));var s=r(0),a=function(e){return-1!==Object.values(n).indexOf(e)},c=function(e){return e===i.LegacyTADS2||e===i.LegacyTADS3||e===i.LegacyHugo||e===i.LegacyAdvSys||"MZ"===e||e===i.ELF||e===i.Java||e===i.AmigaOS||e===i.Script||"MACHO"===e||e===i.PreOSX||e===i.ALAN},u=function(e){return-1!==Object.values(i).indexOf(e)},f=function(e){return e===i.UUIDv1||e===i.UUIDv4};function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var h={AGT_SIGNATURE_INVALID:"The agtSignature option was missing from the options object. This property is needed for legacy AGT IFIDs.",AGT_VERSION_INVALID:"The agtVersion option was missing from the options object. This property is needed for legacy AGT IFIDs.",CHECKSUM_MISSING:"The checksum property was missing from the options object. This property is needed for post-1990 Z-Code IFIDs.",FILE_CONTENTS_MISSING:"An IFID version was selected requiring hashing the contents of a file, but no fileContents property was provided in the options object.",NAME_MISSING:"The name argument was not provided in the argument object.",NAMESPACE_ID_MISSING:"The namespace ID was not provided for the v3/5 UUID to be generated.",NO_HASHER_FOUND:"No suitable hashing function could be found.",RELEASE_NUMBER_MISSING:"The releaseNumber property was missing from the options object. This property is needed for Z-Code IFIDs.",SERIAL_CODE_MISSING:"The serialCode property was missing from the options object. This property is needed for Z-Code IFIDs.",UNRECOGNIZED_DOCUMENTED_MAGNETIC_SCROLLS_TITLE:"The title provided for a Magnetic Scrolls IFID was not recognized. An IFID should be constructed using the undocumented Magnetic Scrolls IFID pattern instead.",UUID_INVALID:"The UUID was not properly generated for the IFID before being requested.",VERSION_INVALID:"The version property of the provided argument object did not meet the isIFIDVersion type guard, or is not implemented."},l=function(){function e(e){if(this.__version=i.UUID,this.__id="",e&&"version"in e){if(!u(e.version))throw new Error(h.VERSION_INVALID);this.__version=e.version}var t=e&&"function"==typeof e.uuidGenerator?e.uuidGenerator:function(e){return new s.UUID({version:e})};if(this.version===i.UUIDv1)this.__uuid=t(1);else if(this.version===i.UUIDv4)this.__uuid=t(4);else if(this.version===i.FileBasedMD5){if(!e.fileContents)throw new Error(h.FILE_CONTENTS_MISSING);var r=s.cryptoJs.MD5(e.fileContents);this.__id=s.cryptoJs.hex.stringify(r)}else if(this.version===i.FileBasedSHA){if(!e.fileContents)throw new Error(h.FILE_CONTENTS_MISSING);var n=s.cryptoJs.SHA256(e.fileContents),f=s.cryptoJs.hex.stringify(n);f.length>63?this.__id=f.slice(0,63):this.__id=f}else if(this.version===i.Pre1990ZCode){if(!e.releaseNumber)throw new Error(h.RELEASE_NUMBER_MISSING);if(!e.serialCode)throw new Error(h.SERIAL_CODE_MISSING);this.__id="ZCODE-"+e.releaseNumber+"-"+e.serialCode}else if(this.version===i.Post1990ZCode){if(!e.releaseNumber)throw new Error(h.RELEASE_NUMBER_MISSING);if(!e.serialCode)throw new Error(h.SERIAL_CODE_MISSING);if(!e.checksum)throw new Error(h.CHECKSUM_MISSING);this.__id="ZCODE-"+e.releaseNumber+"-"+e.serialCode+"-"+e.checksum}else if(c(this.version)){if(!e.fileContents)throw new Error(h.FILE_CONTENTS_MISSING);var d=s.cryptoJs.MD5(e.fileContents),l=s.cryptoJs.hex.stringify(d);this.__id=this.version+"-"+l}else if(this.version===i.DocumentedMagneticScrolls){if(!e.name)throw new Error(h.NAME_MISSING);var p=function(e){return e.replace(/[ ?!]/g,"").toLowerCase()},I=e.name;if(I===o.ThePawn||"thepawn"===p(I))this.__id="MAGNETIC-1";else if(I===o.GuildOfThieves||"guildofthieves"===p(I))this.__id="MAGNETIC-2";else if(I===o.Jinxter||"jinxter"===p(I))this.__id="MAGNETIC-3";else if(I===o.Corruption||"corruption"===p(I))this.__id="MAGNETIC-4";else if(I===o.Fish||"fish"===p(I))this.__id="MAGNETIC-5";else if(I===o.Myth||"myth"===p(I))this.__id="MAGNETIC-6";else{if(I!==o.Wonderland&&"wonderland"!==p(I))throw new Error(h.UNRECOGNIZED_DOCUMENTED_MAGNETIC_SCROLLS_TITLE);this.__id="MAGNETIC-7"}}else if(this.version===i.UndocumentedMagneticScrolls){if(!e.fileContents)throw new Error(h.FILE_CONTENTS_MISSING);var _=s.cryptoJs.MD5(e.fileContents),S=s.cryptoJs.hex.stringify(_);this.__id="MAGNETIC-"+S}else if(this.version===i.LegacyAGT){if(!a(e.agtVersion))throw new Error(h.AGT_VERSION_INVALID);if("string"!=typeof e.agtSignature||!e.agtSignature||8!==e.agtSignature.length)throw new Error(h.AGT_SIGNATURE_INVALID);var v=e.agtVersion,m="AGT-"+(e.agtLargeOrSoggy?v.slice(0,-1)+"1":v)+"-"+e.agtSignature;this.__id=m}}return e.prototype.toString=function(){return this.id},function(e,t,r){t&&d(e.prototype,t),r&&d(e,r)}(e,[{key:"version",get:function(){return this.__version}},{key:"uuid",get:function(){return this.__uuid}},{key:"id",get:function(){if(f(this.version)){if(!this.uuid)throw new Error(h.UUID_INVALID);return this.uuid.toString()}return this.__id}}]),e}();r.d(t,"AGTVersions",function(){return n}),r.d(t,"IFIDVersions",function(){return i}),r.d(t,"MagneticScrollsDocumentedTitles",function(){return o}),r.d(t,"strings",function(){return h}),r.d(t,"IFID",function(){return l})}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ifid=t():e.ifid=t()}(this,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}([function(e,t){},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}},function(e,t,r){e.exports=function(){var e=e||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},o=i.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},s=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var s=r[o>>>2]>>>24-o%4*8&255;t[n+o>>>2]|=s<<24-(n+o)%4*8}else for(var o=0;o<i;o+=4)t[n+o>>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){var t=t,r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},o=0;o<t;o+=4){var a=i(4294967296*(r||e.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new s.init(n,t)}}),a=n.enc={},c=a.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new s.init(r,t/2)}},u=a.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new s.init(r,t)}},f=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,a=4*o,c=i/a,u=(c=t?e.ceil(c):e.max((0|c)-this._minBufferSize,0))*o,f=e.min(4*u,i);if(u){for(var d=0;d<u;d+=o)this._doProcessBlock(n,d);var h=n.splice(0,u);r.sigBytes-=f}return new s.init(h,f)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),h=(i.Hasher=d.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){e&&this._append(e);var t=this._doFinalize();return t},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new h.HMAC.init(e,r).finalize(t)}}}),n.algo={});return n}(Math);return e}()},function(e,t){function r(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(e){return n.exec(e).slice(1)};function o(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}t.resolve=function(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var i=n>=0?arguments[n]:process.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(e=i+"/"+e,t="/"===i.charAt(0))}return e=r(o(e.split("/"),function(e){return!!e}),!t).join("/"),(t?"/":"")+e||"."},t.normalize=function(e){var n=t.isAbsolute(e),i="/"===s(e,-1);return(e=r(o(e.split("/"),function(e){return!!e}),!n).join("/"))||n||(e="."),e&&i&&(e+="/"),(n?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(o(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var i=n(e.split("/")),o=n(r.split("/")),s=Math.min(i.length,o.length),a=s,c=0;c<s;c++)if(i[c]!==o[c]){a=c;break}var u=[];for(c=a;c<i.length;c++)u.push("..");return(u=u.concat(o.slice(a))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=i(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},t.basename=function(e,t){var r=i(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){return i(e)[3]};var s="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}},function(e,t,r){e.exports=function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=r.Hasher,o=[],s=t.algo.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],a=r[3],c=r[4],u=0;u<80;u++){if(u<16)o[u]=0|e[t+u];else{var f=o[u-3]^o[u-8]^o[u-14]^o[u-16];o[u]=f<<1|f>>>31}var d=(n<<5|n>>>27)+c+o[u];d+=u<20?1518500249+(i&s|~i&a):u<40?1859775393+(i^s^a):u<60?(i&s|i&a|s&a)-1894007588:(i^s^a)-899497514,c=a,a=s,s=i<<30|i>>>2,i=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+s|0,r[3]=r[3]+a|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1}(r(2))},function(e,t,r){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,s=r.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=e[t+0],c=e[t+1],l=e[t+2],p=e[t+3],I=e[t+4],_=e[t+5],S=e[t+6],v=e[t+7],m=e[t+8],g=e[t+9],E=e[t+10],y=e[t+11],A=e[t+12],w=e[t+13],N=e[t+14],D=e[t+15],b=o[0],M=o[1],U=o[2],T=o[3];M=h(M=h(M=h(M=h(M=d(M=d(M=d(M=d(M=f(M=f(M=f(M=f(M=u(M=u(M=u(M=u(M,U=u(U,T=u(T,b=u(b,M,U,T,s,7,a[0]),M,U,c,12,a[1]),b,M,l,17,a[2]),T,b,p,22,a[3]),U=u(U,T=u(T,b=u(b,M,U,T,I,7,a[4]),M,U,_,12,a[5]),b,M,S,17,a[6]),T,b,v,22,a[7]),U=u(U,T=u(T,b=u(b,M,U,T,m,7,a[8]),M,U,g,12,a[9]),b,M,E,17,a[10]),T,b,y,22,a[11]),U=u(U,T=u(T,b=u(b,M,U,T,A,7,a[12]),M,U,w,12,a[13]),b,M,N,17,a[14]),T,b,D,22,a[15]),U=f(U,T=f(T,b=f(b,M,U,T,c,5,a[16]),M,U,S,9,a[17]),b,M,y,14,a[18]),T,b,s,20,a[19]),U=f(U,T=f(T,b=f(b,M,U,T,_,5,a[20]),M,U,E,9,a[21]),b,M,D,14,a[22]),T,b,I,20,a[23]),U=f(U,T=f(T,b=f(b,M,U,T,g,5,a[24]),M,U,N,9,a[25]),b,M,p,14,a[26]),T,b,m,20,a[27]),U=f(U,T=f(T,b=f(b,M,U,T,w,5,a[28]),M,U,l,9,a[29]),b,M,v,14,a[30]),T,b,A,20,a[31]),U=d(U,T=d(T,b=d(b,M,U,T,_,4,a[32]),M,U,m,11,a[33]),b,M,y,16,a[34]),T,b,N,23,a[35]),U=d(U,T=d(T,b=d(b,M,U,T,c,4,a[36]),M,U,I,11,a[37]),b,M,v,16,a[38]),T,b,E,23,a[39]),U=d(U,T=d(T,b=d(b,M,U,T,w,4,a[40]),M,U,s,11,a[41]),b,M,p,16,a[42]),T,b,S,23,a[43]),U=d(U,T=d(T,b=d(b,M,U,T,g,4,a[44]),M,U,A,11,a[45]),b,M,D,16,a[46]),T,b,l,23,a[47]),U=h(U,T=h(T,b=h(b,M,U,T,s,6,a[48]),M,U,v,10,a[49]),b,M,N,15,a[50]),T,b,_,21,a[51]),U=h(U,T=h(T,b=h(b,M,U,T,A,6,a[52]),M,U,p,10,a[53]),b,M,E,15,a[54]),T,b,c,21,a[55]),U=h(U,T=h(T,b=h(b,M,U,T,m,6,a[56]),M,U,D,10,a[57]),b,M,S,15,a[58]),T,b,w,21,a[59]),U=h(U,T=h(T,b=h(b,M,U,T,I,6,a[60]),M,U,y,10,a[61]),b,M,l,15,a[62]),T,b,g,21,a[63]),o[0]=o[0]+b|0,o[1]=o[1]+M|0,o[2]=o[2]+U|0,o[3]=o[3]+T|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var o=t.floor(n/4294967296),s=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,c=a.words,u=0;u<4;u++){var f=c[u];c[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,i,o,s){var a=e+(t&r|~t&n)+i+s;return(a<<o|a>>>32-o)+t}function f(e,t,r,n,i,o,s){var a=e+(t&n|r&~n)+i+s;return(a<<o|a>>>32-o)+t}function d(e,t,r,n,i,o,s){var a=e+(t^r^n)+i+s;return(a<<o|a>>>32-o)+t}function h(e,t,r,n,i,o,s){var a=e+(r^(t|~n))+i+s;return(a<<o|a>>>32-o)+t}r.MD5=o._createHelper(c),r.HmacMD5=o._createHmacHelper(c)}(Math),e.MD5}(r(2))},function(e,t,r){e.exports=function(e){return e.enc.Hex}(r(2))},function(e,t,r){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,s=r.algo,a=[],c=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)e(n)&&(i<8&&(a[i]=r(t.pow(n,.5))),c[i]=r(t.pow(n,1/3)),i++),n++}();var u=[],f=s.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],f=r[5],d=r[6],h=r[7],l=0;l<64;l++){if(l<16)u[l]=0|e[t+l];else{var p=u[l-15],I=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,_=u[l-2],S=(_<<15|_>>>17)^(_<<13|_>>>19)^_>>>10;u[l]=I+u[l-7]+S+u[l-16]}var v=n&i^n&o^i&o,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),g=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&f^~a&d)+c[l]+u[l];h=d,d=f,f=a,a=s+g|0,s=o,o=i,i=n,n=g+(m+v)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+f|0,r[6]=r[6]+d|0,r[7]=r[7]+h|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=o._createHelper(f),r.HmacSHA256=o._createHmacHelper(f)}(Math),e.SHA256}(r(2))},function(e,t,r){"use strict";r.r(t);var n={UUID_VERSION_INVALID:"The version argument was not a valid UUID version.",HASH_ARGUMENT_MISSING:"The hash argument was not provided, without which a v3 or v5 UUID cannot be created.",TIMESTAMP_GENERATION_FAILED:"The random number generator did not produce an acceptable value for the random number used in place of a stable timestamp.",TIMESTAMP_INVALID:"The timestamp property of the UUID object is malformed.",NAMESPACE_ID_MISSING:"In order to construct a v3 or v5 UUID, you need to provide a namespace ID to be hashed.",NAME_MISSING:"In order to construct a v3 or v5 UUID, you need to provide a name to be hashed.",CLOCK_SEQUENCE_INVALID:"The clockSequence property of the UUID object is malformed.",CLOCK_SEQUENCE_GENERATION_FAILED:"The random number generator did not produce an acceptable value for the random number used in place of a stable clock sequence.",CLOCK_SEQUENCE_LOW_INVALID:"The clockSequenceLow property of the UUID object is malformed.",CLOCK_SEQUENCE_HIGH_INVALID:"The clockSequenceHigh property of the UUID object is malformed.",CLOCK_HIGH_AND_RESERVED_INVALID:"The clockSequenceHighAndReserved property of the UUID object is malformed.",MAC_ADDRESS_UNAVAILABLE:"The MAC address is unavailable, which makes creating the version 1 node ID impossible.",MAC_ADDRESS_INVALID:"The MAC address was found, but it was malformed.",UUID_LAST_RESULTS_INVALID:"The provided last results object did not meet the isValidLastResults type guard.",UUID_STRING_INVALID:"The text argument passed to UUID.parse was malformed.",UUID_OPTIONS_INVALID:"The options argument passed to one of the UUID methods did not meet the isUUIDOptions type guard.",TIME_LOW_INVALID:"The timestamp property did not produce a valid low portion of the timestamp.",TIME_MID_INVALID:"The timestamp property did not produce a valid mid portion of the timestamp.",TIME_HIGH_INVALID:"The timestamp property did not produce a valid high portion of the timestamp.",TIME_HIGH_AND_VERSION_INVALID:"The timestamp property did not produce a valid high-and-version multiplex.",NODE_IDENTIFIER_INVALID:"The nodeIdentifier property of the UUID object was malformed."},i=r(4),o=r(5),s=r(6),a=function(e,t,r){if(!t)throw new Error(n.NAMESPACE_ID_MISSING);if(!r)throw new Error(n.NAME_MISSING);var a,c=t+r;return a="3"===e.toString()?o(c):i(c),s.stringify(a)},c=function(){return Boolean("undefined"!=typeof process&&process.versions&&process.versions.node)},u=function(e){return/^(nil)|[1345]$/i.test(e.toString())},f=function(e){return parseInt(function(e){return e.reduce(function(e,t){return e+t.toString(16)},"")}(e),16)},d=function(e){for(var t=[],r=e.length;r>0;r-=8){var n=e.slice(r-8,r).padStart(8,"0");t.unshift(parseInt(n,2))}return new Uint8Array(t)},h=r(0);function l(e){return"object"==typeof e&&e&&e.clockSequence&&"BYTES_PER_ELEMENT"in e.clockSequence&&e.nodeIdentifier&&"BYTES_PER_ELEMENT"in e.nodeIdentifier&&e.timestamp&&"BYTES_PER_ELEMENT"in e.timestamp}var p=r(1),I=r(3),_=function(){var e=null;try{var t=Object(h.readFileSync)(Object(I.join)(Object(p.homedir)(),"ifid"),"utf8");e=JSON.parse(t)}catch(e){}return l(e)?e:{}}(),S=function(e){if(c())return new Uint8Array(Object(h.randomBytes)(e));for(var t=window.crypto||window.msCrypto,r=new Uint8Array(e),n=0;n<e;n+=65536)t.getRandomValues(r.subarray(n,n+Math.min(e-n,65536)));return r};function v(e,t){if(!u(e))throw new Error(n.UUID_VERSION_INVALID);var r;if(/^[14]$/.test(e.toString())){if(_.clockSequence&&"BYTES_PER_ELEMENT"in _.clockSequence)return _.clockSequence;r=function(){var e=f(S(2)).toString(2).slice(0,14);return new Uint8Array([parseInt(e.slice(0,6),2),parseInt(e.slice(6),2)])}(),"1"===e.toString()&&(_.clockSequence=r)}else{if(!t)throw new Error(n.HASH_ARGUMENT_MISSING);var i="";i+=t.slice(16,18),i+=t.slice(18,20);var o=parseInt(i,16).toString(2).padStart(14,"0");r=d(o)}return r}function m(e,t){var r;if("1"===e.toString()){if(_.nodeIdentifier&&"BYTES_PER_ELEMENT"in _.nodeIdentifier)return _.nodeIdentifier;r=function(){for(var e=Object(p.networkInterfaces)(),t=Object.keys(e),r=0;r<t.length;r+=1)for(var i=e[t[r]],o=0;o<i.length;o+=1){var s=i[o];if("object"==typeof s&&s){var a=s.mac;if("string"==typeof a&&a&&"00:00:00:00:00:00"!==a){var c=a.split(":").map(function(e){return parseInt(e,16)});return new Uint8Array(c)}}}throw new Error(n.MAC_ADDRESS_UNAVAILABLE)}(),_.nodeIdentifier=r}else if(/^[35]$/.test(e.toString())){if(!t)throw new Error(n.HASH_ARGUMENT_MISSING);var i="";i+=t.slice(20,32);var o=parseInt(i,16).toString(2).padStart(48,"0");o=o.slice(0,7)+"1"+o.slice(8),r=d(o)}else{if("4"!==e.toString())throw new Error(n.UUID_VERSION_INVALID);r=S(6)}return r}function g(){return 10*((new Date).getTime()-new Date(1582,9,15).getTime())}function E(e,t){if(!u(e))throw new Error(n.UUID_VERSION_INVALID);var r;if("1"===e.toString()){var i=_.timestamp,o=g();i&&"BYTES_PER_ELEMENT"in i&&f(i)>o&&_.clockSequence&&"BYTES_PER_ELEMENT"in _.clockSequence&&(_.clockSequence[1]+=1,0===_.clockSequence[1]&&(_.clockSequence[0]+=1));for(var s=o.toString(2).padStart(60,"0"),a=[],c=60;c>0;c-=8){var h=s.slice(c-8,c).padStart(8,"0");a.unshift(parseInt(h,2))}r=new Uint8Array(a)}else if(/^[35]$/.test(e.toString())){if(!t)throw new Error(n.HASH_ARGUMENT_MISSING);var l="";l=t.slice(0,8),l=t.slice(8,12)+l,l=t.slice(12,16)+l;var p=parseInt(l,16).toString(2).padStart(60,"0");r=d(p)}else(r=S(8))[7]=parseInt(r[7].toString(2).slice(0,4),2);return _.timestamp=r,r}var y=function(e){void 0===e&&(e={}),this.version="4",this.clockSequenceGetter=v,this.nodeIdentifierGetter=m,this.timestampGetter=E;var t=e||{};if(t.version){if(!u(t.version))throw new Error(n.UUID_VERSION_INVALID);this.version=t.version}if(t.clockSequenceGetter&&(this.clockSequenceGetter=t.clockSequenceGetter),t.nodeIdentifierGetter&&(this.nodeIdentifierGetter=t.nodeIdentifierGetter),t.timestampGetter&&(this.timestampGetter=t.timestampGetter),t.namespaceId&&(this.namespaceId=t.namespaceId),t.name&&(this.namespaceId=t.namespaceId),/^[35]$/.test(this.version.toString())){if(!this.namespaceId)throw new Error(n.NAMESPACE_ID_MISSING);if(!this.name)throw new Error(n.NAME_MISSING)}},A=function(e){if(!l(e))throw new Error(n.UUID_LAST_RESULTS_INVALID);var t={clockSequence:Array.from(e.clockSequence),nodeIdentifier:Array.from(e.nodeIdentifier),timestamp:Array.from(e.timestamp)};try{Object(h.writeFileSync)(Object(I.join)(Object(p.homedir)(),"ifid"),JSON.stringify(t),{encoding:"utf8"})}catch(e){console.error("Could not save results.")}};function w(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var N,D=function(){function e(e){var t=new y;e&&"object"==typeof e&&(e.version&&(t.version=e.version),e.clockSequenceGetter&&(t.clockSequenceGetter=e.clockSequenceGetter),e.timestampGetter&&(t.timestampGetter=e.timestampGetter),e.nodeIdentifierGetter&&(t.nodeIdentifierGetter=e.nodeIdentifierGetter),e.namespaceId&&(t.namespaceId=e.namespaceId),e.name&&(t.name=e.name));var r=t.version;if(!u(r))throw new Error(n.UUID_VERSION_INVALID);if(c()||"1"===r.toString()&&(console.error("The time-based version 1 UUID cannot be created within the browser. Falling back to the pseudo-random version 4."),r="4"),this.__version=r,/^[35]$/.test(r.toString())){if(!t.namespaceId)throw new Error(n.NAMESPACE_ID_MISSING);if(!t.name)throw new Error(n.NAME_MISSING);var i=a(r,t.namespaceId,t.name),o=t.clockSequenceGetter(r,i);this.__clockSequence=o;var s=t.timestampGetter(r,i);this.__timestamp=s;var f=t.nodeIdentifierGetter(r,i);this.__nodeIdentifier=f}else if(/^nil$/i.test(r.toString()))this.__clockSequence=new Uint8Array([0,0]),this.__timestamp=new Uint8Array([0,0,0,0,0,0,0,0]),this.__nodeIdentifier=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]);else{var d=t.clockSequenceGetter(r);this.__clockSequence=d;var h=t.timestampGetter(r);this.__timestamp=h;var l=t.nodeIdentifierGetter(r);this.__nodeIdentifier=l,c()&&"1"===this.version.toString()&&A(this)}}return e.parse=function(e){var t=e.split("-");if(5!==t.length)throw new Error(n.UUID_STRING_INVALID);for(var r=t[0],i=t[1],o=t[2],s=o.slice(0,3),a=o[4],c=s+i+r,u=[],f=0;f<16;f+=2)u.push(parseInt(c.slice(f,f+2),16));for(var d=new Uint8Array(u),h=t[3],l=h.slice(0,2),p=parseInt(parseInt(l,16).toString(2).slice(2),2).toString(16),I=h.slice(2,4)+p,_=[],S=0;S<7;S+=2)_.push(parseInt(I.slice(S,S+2),16));for(var v=new Uint8Array(_),m=t[4],g=[],E=0;E<12;E+=2)g.push(parseInt(m.slice(E,E+2),16));var y=new Uint8Array(g);return Object.assign({},this.prototype,{__version:a,__timestamp:d,__clockSequence:v,__nodeIdentifier:y})},e.prototype.toString=function(){var e=function(e,t){return f(e).toString(16).padStart(t,"0")};return e(this.timeLow,8)+"-"+e(this.timeMid,4)+"-"+e(this.timeHighAndVersion,4)+"-"+e(this.clockSequenceHighAndReserved,2)+e(this.clockSequenceLow,2)+"-"+e(this.nodeIdentifier,12)},function(e,t,r){t&&w(e.prototype,t)}(e,[{key:"version",get:function(){return this.__version}},{key:"timestamp",get:function(){return this.__timestamp}},{key:"timeLow",get:function(){return this.timestamp.slice(4,8)}},{key:"timeMid",get:function(){return this.timestamp.slice(2,4)}},{key:"timeHigh",get:function(){return this.timestamp.slice(0,2)}},{key:"timeHighAndVersion",get:function(){var e=this.timeHigh,t=/^nil$/i.test(this.version.toString())?"0":parseInt(this.version.toString()).toString(2),r=f(e).toString(2),n=t.padStart(4,"0")+r.padStart(12,"0"),i=parseInt(n.slice(0,8),2),o=parseInt(n.slice(8,16),2);return new Uint8Array([i,o])}},{key:"clockSequence",get:function(){return this.__clockSequence}},{key:"clockSequenceLow",get:function(){return this.clockSequence.slice(0,1)}},{key:"clockSequenceHigh",get:function(){return this.clockSequence.slice(1)}},{key:"reserved",get:function(){return new Uint8Array([2])}},{key:"clockSequenceHighAndReserved",get:function(){var e=f(this.clockSequenceHigh).toString(2),t=/^nil$/i.test(this.version.toString())?"0":f(this.reserved).toString(2),r=e.padStart(6,"0")+t.padStart(2,"0");return new Uint8Array([parseInt(r,2)])}},{key:"nodeIdentifier",get:function(){return this.__nodeIdentifier}}]),e}();!function(e){e.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",e.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",e.OID="6ba7b812-9dad-11d1-80b4-00c04fd430c8",e.X500="6ba7b814-9dad-11d1-80b4-00c04fd430c8"}(N||(N={})),r.d(t,"cryptoJs",function(){return T}),r.d(t,"UUID",function(){return D}),r.d(t,"UUIDOptions",function(){return y}),r.d(t,"NamespaceIds",function(){return N}),r.d(t,"clockSequenceGetter",function(){return v}),r.d(t,"getHashFromNamespaceIdAndName",function(){return a}),r.d(t,"getHundredsOfNanosecondsSinceGregorianReform",function(){return g}),r.d(t,"nodeIdentifierGetter",function(){return m}),r.d(t,"timestampGetter",function(){return E}),r.d(t,"uintArrayAsNumber",function(){return f});var b=r(4),M=r(7),U=r(5),T={hex:r(6),MD5:U,SHA1:b,SHA256:M}}])},function(e,t,r){"use strict";var n;r.r(t),function(e){e.v1_0="00000",e.v1_18="01800",e.v1_19="01900",e.v1_20="02000",e.v1_32_COS="03200",e.v1_35="03500",e.v1_5H="05000",e.v1_5F="05050",e.v1_6="05070",e.v1_82="08200",e.v1_83="08300",e.ME_1_0="10000",e.ME_1_5="15000",e.ME_1_6="16000",e.Magx_0_0="20000"}(n||(n={}));var i;!function(e){e.UUID="UUIDv4",e.UUIDv1="UUIDv1",e.UUIDv4="UUIDv4",e.FileBased="FileBasedSHA",e.FileBasedSHA="FileBasedSHA",e.FileBasedMD5="FileBasedMD5",e.Pre1990ZCode="Pre1990ZCode",e.Post1990ZCode="Post1990ZCode",e.LegacyTADS2="TADS2",e.LegacyTADS3="TADS3",e.LegacyHugo="HUGO",e.DocumentedMagneticScrolls="DocumentedMagneticScrolls",e.UndocumentedMagneticScrolls="MAGNETIC",e.LegacyAGT="LegacyAGT",e.LegacyAdvSys="ADVSYS",e.MSDOS="MZ",e.Windows="MZ",e.OS2="MZ",e.ELF="ELF",e.Java="JAVA",e.AmigaOS="AMIGA",e.Script="SCRIPT",e.MacOSX="MACHO",e.MachO="MACHO",e.PreOSX="MAC",e.ALAN="ALAN"}(i||(i={}));var o;!function(e){e.ThePawn="The Pawn",e.GuildOfThieves="Guild of Thieves",e.Jinxter="Jinxter",e.Corruption="Corruption",e.Fish="Fish!",e.Myth="Myth",e.Wonderland="Wonderland"}(o||(o={}));var s=r(0),a=function(e){return-1!==Object.values(n).indexOf(e)},c=function(e){return e===i.LegacyTADS2||e===i.LegacyTADS3||e===i.LegacyHugo||e===i.LegacyAdvSys||"MZ"===e||e===i.ELF||e===i.Java||e===i.AmigaOS||e===i.Script||"MACHO"===e||e===i.PreOSX||e===i.ALAN},u=function(e){return-1!==Object.values(i).indexOf(e)},f=function(e){return e===i.UUIDv1||e===i.UUIDv4};function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var h={AGT_SIGNATURE_INVALID:"The agtSignature option was missing from the options object. This property is needed for legacy AGT IFIDs.",AGT_VERSION_INVALID:"The agtVersion option was missing from the options object. This property is needed for legacy AGT IFIDs.",CHECKSUM_MISSING:"The checksum property was missing from the options object. This property is needed for post-1990 Z-Code IFIDs.",FILE_CONTENTS_MISSING:"An IFID version was selected requiring hashing the contents of a file, but no fileContents property was provided in the options object.",NAME_MISSING:"The name argument was not provided in the argument object.",NAMESPACE_ID_MISSING:"The namespace ID was not provided for the v3/5 UUID to be generated.",NO_HASHER_FOUND:"No suitable hashing function could be found.",RELEASE_NUMBER_MISSING:"The releaseNumber property was missing from the options object. This property is needed for Z-Code IFIDs.",SERIAL_CODE_MISSING:"The serialCode property was missing from the options object. This property is needed for Z-Code IFIDs.",UNRECOGNIZED_DOCUMENTED_MAGNETIC_SCROLLS_TITLE:"The title provided for a Magnetic Scrolls IFID was not recognized. An IFID should be constructed using the undocumented Magnetic Scrolls IFID pattern instead.",UUID_INVALID:"The UUID was not properly generated for the IFID before being requested.",VERSION_INVALID:"The version property of the provided argument object did not meet the isIFIDVersion type guard, or is not implemented."},l=function(){function e(e){if(this.__version=i.UUID,this.__id="",e&&"version"in e){if(!u(e.version))throw new Error(h.VERSION_INVALID);this.__version=e.version}var t=e&&"function"==typeof e.uuidGenerator?e.uuidGenerator:function(e){return new s.UUID({version:e})};if(this.version===i.UUIDv1)this.__uuid=t(1);else if(this.version===i.UUIDv4)this.__uuid=t(4);else if(this.version===i.FileBasedMD5){if(!e.fileContents)throw new Error(h.FILE_CONTENTS_MISSING);var r=s.cryptoJs.MD5(e.fileContents);this.__id=s.cryptoJs.hex.stringify(r)}else if(this.version===i.FileBasedSHA){if(!e.fileContents)throw new Error(h.FILE_CONTENTS_MISSING);var n=s.cryptoJs.SHA256(e.fileContents),f=s.cryptoJs.hex.stringify(n);f.length>63?this.__id=f.slice(0,63):this.__id=f}else if(this.version===i.Pre1990ZCode){if(!e.releaseNumber)throw new Error(h.RELEASE_NUMBER_MISSING);if(!e.serialCode)throw new Error(h.SERIAL_CODE_MISSING);this.__id="ZCODE-"+e.releaseNumber+"-"+e.serialCode}else if(this.version===i.Post1990ZCode){if(!e.releaseNumber)throw new Error(h.RELEASE_NUMBER_MISSING);if(!e.serialCode)throw new Error(h.SERIAL_CODE_MISSING);if(!e.checksum)throw new Error(h.CHECKSUM_MISSING);this.__id="ZCODE-"+e.releaseNumber+"-"+e.serialCode+"-"+e.checksum}else if(c(this.version)){if(!e.fileContents)throw new Error(h.FILE_CONTENTS_MISSING);var d=s.cryptoJs.MD5(e.fileContents),l=s.cryptoJs.hex.stringify(d);this.__id=this.version+"-"+l}else if(this.version===i.DocumentedMagneticScrolls){if(!e.name)throw new Error(h.NAME_MISSING);var p=function(e){return e.replace(/[ ?!]/g,"").toLowerCase()},I=e.name;if(I===o.ThePawn||"thepawn"===p(I))this.__id="MAGNETIC-1";else if(I===o.GuildOfThieves||"guildofthieves"===p(I))this.__id="MAGNETIC-2";else if(I===o.Jinxter||"jinxter"===p(I))this.__id="MAGNETIC-3";else if(I===o.Corruption||"corruption"===p(I))this.__id="MAGNETIC-4";else if(I===o.Fish||"fish"===p(I))this.__id="MAGNETIC-5";else if(I===o.Myth||"myth"===p(I))this.__id="MAGNETIC-6";else{if(I!==o.Wonderland&&"wonderland"!==p(I))throw new Error(h.UNRECOGNIZED_DOCUMENTED_MAGNETIC_SCROLLS_TITLE);this.__id="MAGNETIC-7"}}else if(this.version===i.UndocumentedMagneticScrolls){if(!e.fileContents)throw new Error(h.FILE_CONTENTS_MISSING);var _=s.cryptoJs.MD5(e.fileContents),S=s.cryptoJs.hex.stringify(_);this.__id="MAGNETIC-"+S}else if(this.version===i.LegacyAGT){if(!a(e.agtVersion))throw new Error(h.AGT_VERSION_INVALID);if("string"!=typeof e.agtSignature||!e.agtSignature||8!==e.agtSignature.length)throw new Error(h.AGT_SIGNATURE_INVALID);var v=e.agtVersion,m="AGT-"+(e.agtLargeOrSoggy?v.slice(0,-1)+"1":v)+"-"+e.agtSignature;this.__id=m}}return e.prototype.toString=function(){return this.id},function(e,t,r){t&&d(e.prototype,t),r&&d(e,r)}(e,[{key:"version",get:function(){return this.__version}},{key:"uuid",get:function(){return this.__uuid}},{key:"id",get:function(){if(f(this.version)){if(!this.uuid)throw new Error(h.UUID_INVALID);return this.uuid.toString()}return this.__id}}]),e}();r.d(t,"AGTVersions",function(){return n}),r.d(t,"IFIDVersions",function(){return i}),r.d(t,"MagneticScrollsDocumentedTitles",function(){return o}),r.d(t,"strings",function(){return h}),r.d(t,"IFID",function(){return l})}])}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "ifid", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "A package to generate Interactive Fiction Identifiers.", | ||
@@ -53,3 +53,3 @@ "main": "dist/node.es6/index.js", | ||
"dependencies": { | ||
"big-uuid": "^0.3.6" | ||
"big-uuid": "^0.4.1" | ||
}, | ||
@@ -56,0 +56,0 @@ "jest": { |
@@ -7,7 +7,7 @@ [![Build Status](https://travis-ci.org/furkleindustries/ifid.svg?branch=master)](https://travis-ci.org/furkleindustries/ifid) | ||
An Interactive Fiction Identifier (IFID) generating class and helper functions. Implements both RFC 4112 UUIDs (versions 1, 3, 4, and 5), as well as essentially all of the Treaty of Babel, revision 9, as it applies to IFIDs. | ||
An Interactive Fiction Identifier (IFID) generating class and helper functions. Implements both RFC 4112 UUIDs (versions 1, and 4), as well as essentially all of the Treaty of Babel, revision 9, as it applies to IFIDs. This package relies on the [big-uuid](https://github.com/furkleindustries/big-uuid) package for its generation of v1 and v4 UUIDs. | ||
## Usage notes | ||
* A good deal of the generation methods (in particular UUIDv1, UUIDv3, and all the file-based and MD5 Treaty of Babel methods) will not work well, or at all, in the browser. | ||
* Many of the generation methods utilize MD5. This is for historical compatibility with UUIDv3 and many aspects of the Treaty of Babel. However, MD5 has since proven to be dangerously inadequate as a hashing algorithm, and extreme caution should be taken by anyone intending to use it to create a permanently unique identifier. | ||
* Many of the generation methods utilize MD5. This is for historical compatibility with many aspects of the Treaty of Babel. However, MD5 has since proven to be dangerously inadequate as a hashing algorithm, and extreme caution should be taken by anyone intending to use it to create a permanently unique identifier. | ||
* UUID v3 and v5 have been omitted from the IFID generator. If you want to generate these IDs, use [big-uuid](https://github.com/furkleindustries/big-uuid) directly. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
175332
1706
13
+ Addedbig-uuid@0.4.5(transitive)
- Removedbig-uuid@0.3.6(transitive)
Updatedbig-uuid@^0.4.1