Socket
Socket
Sign inDemoInstall

pure-uuid

Package Overview
Dependencies
0
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.5.7 to 1.5.8

12

package.json

@@ -5,3 +5,3 @@ {

"description": "Pure JavaScript Based Universally Unique Identifier (UUID)",
"version": "1.5.7",
"version": "1.5.8",
"license": "MIT",

@@ -26,11 +26,11 @@ "author": {

"devDependencies": {
"grunt": "1.0.3",
"grunt": "1.0.4",
"grunt-cli": "1.3.2",
"grunt-contrib-jshint": "2.0.0",
"grunt-contrib-uglify": "4.0.0",
"grunt-contrib-jshint": "2.1.0",
"grunt-contrib-uglify": "4.0.1",
"grunt-contrib-clean": "2.0.0",
"grunt-eslint": "21.0.0",
"grunt-eslint": "22.0.0",
"grunt-mocha-test": "0.13.3",
"chai": "4.2.0",
"mocha": "5.2.0"
"mocha": "6.2.2"
},

@@ -37,0 +37,0 @@ "dependencies" : {

@@ -28,3 +28,2 @@ /*!

/* global define: false */
/* global module: false */
if (typeof define === "function" && typeof define.amd !== "undefined")

@@ -694,3 +693,2 @@ /* AMD environment */

/* global Uint8Array: false */
/* global Buffer: false */
if (typeof Uint8Array !== "undefined")

@@ -697,0 +695,0 @@ /* HTML5 TypedArray (browser environments: IE10, FF, CH, SF, OP)

@@ -1,1 +0,1 @@

!function(r,t,e){"function"==typeof define&&void 0!==define.amd?define(function(){return e()}):"object"==typeof module&&"object"==typeof module.exports?(module.exports=e(),module.exports.default=module.exports):r.UUID=e()}(this,0,function(){var i=function(r,t,e,i,n,o){for(var a,f,u,s=t;s<=e;s++)n[o++]=(a=r[s],f=i,u=void 0,(u=a.toString(16)).length<2&&(u="0"+u),f&&(u=u.toUpperCase()),u);return n},n=function(r,t,e,i,n){for(var o=t;o<=e;o+=2)i[n++]=parseInt(r.substr(o,2),16)},f="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#".split(""),u=[0,68,0,84,83,82,72,0,75,76,70,65,0,63,62,69,0,1,2,3,4,5,6,7,8,9,64,0,73,66,74,71,81,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,77,0,78,67,0,0,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,79,0,80,0,0],t=function(r,t){var e={ibits:8,obits:8,obigendian:!0};for(var i in t)void 0!==e[i]&&(e[i]=t[i]);for(var n,o,a,f=[],u=0,s=0,h=0,c=r.length;0===s&&(o=r.charCodeAt(u++)),n=o>>e.ibits-(s+8)&255,s=(s+8)%e.ibits,e.obigendian?0===h?a=n<<e.obits-8:a|=n<<e.obits-8-h:0===h?a=n:a|=n<<h,!(0===(h=(h+8)%e.obits)&&(f.push(a),c<=u)););return f},e=function(r,t){var e={ibits:32,ibigendian:!0};for(var i in t)void 0!==e[i]&&(e[i]=t[i]);var n="",o=4294967295;e.ibits<32&&(o=(1<<e.ibits)-1);for(var a=r.length,f=0;f<a;f++)for(var u=r[f]&o,s=0;s<e.ibits;s+=8)e.ibigendian?n+=String.fromCharCode(u>>e.ibits-8-s&255):n+=String.fromCharCode(u>>s&255);return n},d=256,v=function(r,t,e,i,n,o,a,f){return[f,a,o,n,i,e,t,r]},a=function(){return v(0,0,0,0,0,0,0,0)},o=function(r){return r.slice(0)},p=function(r){for(var t=a(),e=0;e<8;e++)t[e]=Math.floor(r%d),r/=d;return t},s=function(r){for(var t=0,e=7;0<=e;e--)t*=d,t+=r[e];return Math.floor(t)},l=function(r,t){for(var e=0,i=0;i<8;i++)e+=r[i]+t[i],r[i]=Math.floor(e%d),e=Math.floor(e/d);return e},h=function(r,t){for(var e=0;e<8;e++)r[e]&=t[e];return r},b=function(r,t){var e=a();if(t%8!=0)throw new Error("ui64_rorn: only bit rotations supported with a multiple of digit bits");for(var i=Math.floor(t/8),n=0;n<i;n++){for(var o=6;0<=o;o--)e[o+1]=e[o];for(e[0]=r[0],o=0;o<7;o++)r[o]=r[o+1];r[o]=0}return s(e)},c=function(r,t){if(64<t)throw new Error("ui64_ror: invalid number of bits to shift");var e,i=new Array(16);for(e=0;e<8;e++)i[e+8]=r[e],i[e]=0;var n=Math.floor(t/8),o=t%8;for(e=n;e<15;e++)i[e-n]=255&(i[e]>>>o|i[e+1]<<8-o);for(i[15-n]=i[15]>>>o&255,e=15-n+1;e<16;e++)i[e]=0;for(e=0;e<8;e++)r[e]=i[e+8];return i.slice(0,8)},x=function(r,t){for(var e=0;e<8;e++)r[e]^=t[e]},g=function(r,t){var e=(65535&r)+(65535&t);return(r>>16)+(t>>16)+(e>>16)<<16|65535&e},U=function(r,t){return r<<t&4294967295|r>>>32-t&4294967295},m=function(r){return e(function(r,t){r[t>>5]|=128<<24-t%32,r[15+(t+64>>9<<4)]=t;for(var e,i,n,o,a,f=Array(80),u=1732584193,s=-271733879,h=-1732584194,c=271733878,d=-1009589776,v=0;v<r.length;v+=16){for(var p=u,l=s,b=h,x=c,m=d,w=0;w<80;w++){f[w]=w<16?r[v+w]:U(f[w-3]^f[w-8]^f[w-14]^f[w-16],1);var y=g(g(U(u,5),(n=s,o=h,a=c,(i=w)<20?n&o|~n&a:i<40?n^o^a:i<60?n&o|n&a|o&a:n^o^a)),g(g(d,f[w]),(e=w)<20?1518500249:e<40?1859775393:e<60?-1894007588:-899497514));d=c,c=h,h=U(s,30),s=u,u=y}u=g(u,p),s=g(s,l),h=g(h,b),c=g(c,x),d=g(d,m)}return[u,s,h,c,d]}(t(r,{ibits:8,obits:32,obigendian:!0}),8*r.length),{ibits:32,ibigendian:!0})},w=function(r){return e(function(r,t){function f(r,t,e,i,n,o){return g(U(g(g(t,r),g(i,o)),n),e)}function e(r,t,e,i,n,o,a){return f(t&e|~t&i,r,t,n,o,a)}function i(r,t,e,i,n,o,a){return f(t&i|e&~i,r,t,n,o,a)}function n(r,t,e,i,n,o,a){return f(t^e^i,r,t,n,o,a)}function o(r,t,e,i,n,o,a){return f(e^(t|~i),r,t,n,o,a)}r[t>>5]|=128<<t%32,r[14+(t+64>>>9<<4)]=t;for(var a=1732584193,u=-271733879,s=-1732584194,h=271733878,c=0;c<r.length;c+=16){var d=a,v=u,p=s,l=h;u=o(u=o(u=o(u=o(u=n(u=n(u=n(u=n(u=i(u=i(u=i(u=i(u=e(u=e(u=e(u=e(u,s=e(s,h=e(h,a=e(a,u,s,h,r[c+0],7,-680876936),u,s,r[c+1],12,-389564586),a,u,r[c+2],17,606105819),h,a,r[c+3],22,-1044525330),s=e(s,h=e(h,a=e(a,u,s,h,r[c+4],7,-176418897),u,s,r[c+5],12,1200080426),a,u,r[c+6],17,-1473231341),h,a,r[c+7],22,-45705983),s=e(s,h=e(h,a=e(a,u,s,h,r[c+8],7,1770035416),u,s,r[c+9],12,-1958414417),a,u,r[c+10],17,-42063),h,a,r[c+11],22,-1990404162),s=e(s,h=e(h,a=e(a,u,s,h,r[c+12],7,1804603682),u,s,r[c+13],12,-40341101),a,u,r[c+14],17,-1502002290),h,a,r[c+15],22,1236535329),s=i(s,h=i(h,a=i(a,u,s,h,r[c+1],5,-165796510),u,s,r[c+6],9,-1069501632),a,u,r[c+11],14,643717713),h,a,r[c+0],20,-373897302),s=i(s,h=i(h,a=i(a,u,s,h,r[c+5],5,-701558691),u,s,r[c+10],9,38016083),a,u,r[c+15],14,-660478335),h,a,r[c+4],20,-405537848),s=i(s,h=i(h,a=i(a,u,s,h,r[c+9],5,568446438),u,s,r[c+14],9,-1019803690),a,u,r[c+3],14,-187363961),h,a,r[c+8],20,1163531501),s=i(s,h=i(h,a=i(a,u,s,h,r[c+13],5,-1444681467),u,s,r[c+2],9,-51403784),a,u,r[c+7],14,1735328473),h,a,r[c+12],20,-1926607734),s=n(s,h=n(h,a=n(a,u,s,h,r[c+5],4,-378558),u,s,r[c+8],11,-2022574463),a,u,r[c+11],16,1839030562),h,a,r[c+14],23,-35309556),s=n(s,h=n(h,a=n(a,u,s,h,r[c+1],4,-1530992060),u,s,r[c+4],11,1272893353),a,u,r[c+7],16,-155497632),h,a,r[c+10],23,-1094730640),s=n(s,h=n(h,a=n(a,u,s,h,r[c+13],4,681279174),u,s,r[c+0],11,-358537222),a,u,r[c+3],16,-722521979),h,a,r[c+6],23,76029189),s=n(s,h=n(h,a=n(a,u,s,h,r[c+9],4,-640364487),u,s,r[c+12],11,-421815835),a,u,r[c+15],16,530742520),h,a,r[c+2],23,-995338651),s=o(s,h=o(h,a=o(a,u,s,h,r[c+0],6,-198630844),u,s,r[c+7],10,1126891415),a,u,r[c+14],15,-1416354905),h,a,r[c+5],21,-57434055),s=o(s,h=o(h,a=o(a,u,s,h,r[c+12],6,1700485571),u,s,r[c+3],10,-1894986606),a,u,r[c+10],15,-1051523),h,a,r[c+1],21,-2054922799),s=o(s,h=o(h,a=o(a,u,s,h,r[c+8],6,1873313359),u,s,r[c+15],10,-30611744),a,u,r[c+6],15,-1560198380),h,a,r[c+13],21,1309151649),s=o(s,h=o(h,a=o(a,u,s,h,r[c+4],6,-145523070),u,s,r[c+11],10,-1120210379),a,u,r[c+2],15,718787259),h,a,r[c+9],21,-343485551),a=g(a,d),u=g(u,v),s=g(s,p),h=g(h,l)}return[a,u,s,h]}(t(r,{ibits:8,obits:32,obigendian:!1}),8*r.length),{ibits:32,ibigendian:!1})},r=function(r){this.mul=v(88,81,244,45,76,149,127,45),this.inc=v(20,5,123,126,247,103,129,79),this.mask=v(0,0,0,0,255,255,255,255),this.state=o(this.inc),this.next(),h(this.state,this.mask),r=p(void 0!==r?r>>>0:4294967295*Math.random()>>>0),function(r,t){for(var e=0;e<8;e++)r[e]|=t[e]}(this.state,r),this.next()};r.prototype.next=function(){var r=o(this.state);!function(r,t){var e,i,n,o=new Array(16);for(e=0;e<16;e++)o[e]=0;for(e=0;e<8;e++){for(i=n=0;i<8;i++)n+=r[e]*t[i]+o[e+i],o[e+i]=n%d,n/=d;for(;i<16-e;i++)n+=o[e+i],o[e+i]=n%d,n/=d}for(e=0;e<8;e++)r[e]=o[e];o.slice(8,8)}(this.state,this.mul),l(this.state,this.inc);var t=o(r);c(t,18),x(t,r),c(t,27);var e=o(r);c(e,59),h(t,this.mask);var i=s(e),n=o(t);return function(r,t){if(64<t)throw new Error("ui64_rol: invalid number of bits to shift");var e,i=new Array(16);for(e=0;e<8;e++)i[e+8]=0,i[e]=r[e];var n=Math.floor(t/8),o=t%8;for(e=7-n;0<e;e--)i[e+n]=255&(i[e]<<o|i[e-1]>>>8-o);for(i[0+n]=i[0]<<o&255,e=0+n-1;0<=e;e--)i[e]=0;for(e=0;e<8;e++)r[e]=i[e];i.slice(8,8)}(n,32-i),c(t,i),x(t,n),s(t)};var y=new r,A=function(r,t){for(var e=[],i=0;i<r;i++)e[i]=y.next()%t;return e},D=0,E=0,I=function(){if(1===arguments.length&&"string"==typeof arguments[0])this.parse.apply(this,arguments);else if(1<=arguments.length&&"number"==typeof arguments[0])this.make.apply(this,arguments);else{if(1<=arguments.length)throw new Error("UUID: constructor: invalid arguments");for(var r=0;r<16;r++)this[r]=0}};return((I.prototype="undefined"!=typeof Uint8Array?new Uint8Array(16):Buffer?new Buffer(16):new Array(16)).constructor=I).prototype.make=function(r){var t,e=this;if(1===r){var i=(new Date).getTime();i!==D?E=0:E++;var n,o=p(D=i);!function(r,t){for(var e=0,i=0;i<8;i++)e+=r[i]*t,r[i]=Math.floor(e%d),e=Math.floor(e/d)}(o,1e4),l(o,v(1,178,29,210,19,129,64,0)),0<E&&l(o,p(E)),n=b(o,8),e[3]=255&n,n=b(o,8),e[2]=255&n,n=b(o,8),e[1]=255&n,n=b(o,8),e[0]=255&n,n=b(o,8),e[5]=255&n,n=b(o,8),e[4]=255&n,n=b(o,8),e[7]=255&n,n=b(o,8),e[6]=15&n;var a=A(2,255);e[8]=a[0],e[9]=a[1];var f=A(6,255);for(f[0]|=1,f[0]|=2,t=0;t<6;t++)e[10+t]=f[t]}else if(4===r){var u=A(16,255);for(t=0;t<16;t++)this[t]=u[t]}else{if(3!==r&&5!==r)throw new Error("UUID: make: invalid version");var s="",h="object"==typeof arguments[1]&&arguments[1]instanceof I?arguments[1]:(new I).parse(arguments[1]);for(t=0;t<16;t++)s+=String.fromCharCode(h[t]);s+=arguments[2];var c=3===r?w(s):m(s);for(t=0;t<16;t++)e[t]=c.charCodeAt(t)}return e[6]&=15,e[6]|=r<<4,e[8]&=63,e[8]|=128,e},I.prototype.format=function(r){var t,e;return"z85"===r?t=function(r,t){if(t%4!=0)throw new Error("z85_encode: invalid input length (multiple of 4 expected)");for(var e="",i=0,n=0;i<t;)if(n=256*n+r[i++],i%4==0){for(var o=52200625;1<=o;){var a=Math.floor(n/o)%85;e+=f[a],o/=85}n=0}return e}(this,16):"b16"===r?(e=Array(32),i(this,0,15,!0,e,0),t=e.join("")):void 0!==r&&"std"!==r||(e=new Array(36),i(this,0,3,!1,e,0),e[8]="-",i(this,4,5,!1,e,9),e[13]="-",i(this,6,7,!1,e,14),e[18]="-",i(this,8,9,!1,e,19),e[23]="-",i(this,10,15,!1,e,24),t=e.join("")),t},I.prototype.toString=function(r){return this.format(r)},I.prototype.parse=function(r,t){if("string"!=typeof r)throw new Error("UUID: parse: invalid argument (type string expected)");if("z85"===t)!function(r,t){var e=r.length;if(e%5!=0)throw new Error("z85_decode: invalid input length (multiple of 5 expected)");void 0===t&&(t=new Array(4*e/5));for(var i=0,n=0,o=0;i<e;){var a=r.charCodeAt(i++)-32;if(a<0||u.length<=a)break;if(o=85*o+u[a],i%5==0){for(var f=16777216;1<=f;)t[n++]=Math.trunc(o/f%256),f/=256;o=0}}}(r,this);else if("b16"===t)n(r,0,35,this,0);else if(void 0===t||"std"===t){var e={nil:"00000000-0000-0000-0000-000000000000","ns:DNS":"6ba7b810-9dad-11d1-80b4-00c04fd430c8","ns:URL":"6ba7b811-9dad-11d1-80b4-00c04fd430c8","ns:OID":"6ba7b812-9dad-11d1-80b4-00c04fd430c8","ns:X500":"6ba7b814-9dad-11d1-80b4-00c04fd430c8"};if(void 0!==e[r])r=e[r];else if(!r.match(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/))throw new Error('UUID: parse: invalid string representation (expected "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")');n(r,0,7,this,0),n(r,9,12,this,4),n(r,14,17,this,6),n(r,19,22,this,8),n(r,24,35,this,10)}return this},I.prototype.export=function(){for(var r=Array(16),t=0;t<16;t++)r[t]=this[t];return r},I.prototype.import=function(r){if(!("object"==typeof r&&r instanceof Array))throw new Error("UUID: import: invalid argument (type Array expected)");if(16!==r.length)throw new Error("UUID: import: invalid argument (Array of length 16 expected)");for(var t=0;t<16;t++){if("number"!=typeof r[t])throw new Error("UUID: import: invalid array element #"+t+" (type Number expected)");if(!isFinite(r[t])||Math.floor(r[t])!==r[t])throw new Error("UUID: import: invalid array element #"+t+" (Number with integer value expected)");if(!(0<=r[t]&&r[t]<=255))throw new Error("UUID: import: invalid array element #"+t+" (Number with integer value in range 0...255 expected)");this[t]=r[t]}return this},I.prototype.compare=function(r){if("object"!=typeof r)throw new Error("UUID: compare: invalid argument (type UUID expected)");if(!(r instanceof I))throw new Error("UUID: compare: invalid argument (type UUID expected)");for(var t=0;t<16;t++){if(this[t]<r[t])return-1;if(this[t]>r[t])return 1}return 0},I.prototype.fold=function(r){if(void 0===r)throw new Error("UUID: fold: invalid argument (number of fold operations expected)");if(r<1||4<r)throw new Error("UUID: fold: invalid argument (1-4 fold operations expected)");for(var t=16/Math.pow(2,r),e=new Array(t),i=0;i<t;i++){for(var n=0,o=0;i+o<16;o+=t)n^=this[i+o];e[i]=n}return e},I.PCG=r,I});
!function(r,t){"function"==typeof define&&void 0!==define.amd?define(function(){return t()}):"object"==typeof module&&"object"==typeof module.exports?(module.exports=t(),module.exports.default=module.exports):r.UUID=t()}(this,function(){function o(r,t,e,o,i,n){for(var a,f,u,s=t;s<=e;s++)i[n++]=(a=r[s],f=o,u=void 0,(u=a.toString(16)).length<2&&(u="0"+u),f&&(u=u.toUpperCase()),u);return i}function i(r,t,e,o,i){for(var n=t;n<=e;n+=2)o[i++]=parseInt(r.substr(n,2),16)}function t(r,t){var e={ibits:8,obits:8,obigendian:!0};for(var o in t)void 0!==e[o]&&(e[o]=t[o]);for(var i,n,a,f=[],u=0,s=0,h=0,c=r.length;0===s&&(n=r.charCodeAt(u++)),i=n>>e.ibits-(s+8)&255,s=(s+8)%e.ibits,e.obigendian?0===h?a=i<<e.obits-8:a|=i<<e.obits-8-h:0===h?a=i:a|=i<<h,!(0===(h=(h+8)%e.obits)&&(f.push(a),c<=u)););return f}function e(r,t){var e={ibits:32,ibigendian:!0};for(var o in t)void 0!==e[o]&&(e[o]=t[o]);var i="",n=4294967295;e.ibits<32&&(n=(1<<e.ibits)-1);for(var a=r.length,f=0;f<a;f++)for(var u=r[f]&n,s=0;s<e.ibits;s+=8)e.ibigendian?i+=String.fromCharCode(u>>e.ibits-8-s&255):i+=String.fromCharCode(u>>s&255);return i}function d(r,t,e,o,i,n,a,f){return[f,a,n,i,o,e,t,r]}function a(){return d(0,0,0,0,0,0,0,0)}function n(r){return r.slice(0)}function p(r){for(var t=a(),e=0;e<8;e++)t[e]=Math.floor(r%w),r/=w;return t}function f(r){for(var t=0,e=7;0<=e;e--)t*=w,t+=r[e];return Math.floor(t)}function v(r,t){for(var e=0,o=0;o<8;o++)e+=r[o]+t[o],r[o]=Math.floor(e%w),e=Math.floor(e/w);return e}function u(r,t){for(var e=0;e<8;e++)r[e]&=t[e];return r}function l(r,t){var e=a();if(t%8!=0)throw new Error("ui64_rorn: only bit rotations supported with a multiple of digit bits");for(var o=Math.floor(t/8),i=0;i<o;i++){for(var n=6;0<=n;n--)e[n+1]=e[n];for(e[0]=r[0],n=0;n<7;n++)r[n]=r[n+1];r[n]=0}return f(e)}function s(r,t){if(64<t)throw new Error("ui64_ror: invalid number of bits to shift");var e,o=new Array(16);for(e=0;e<8;e++)o[e+8]=r[e],o[e]=0;var i=Math.floor(t/8),n=t%8;for(e=i;e<15;e++)o[e-i]=255&(o[e]>>>n|o[e+1]<<8-n);for(o[15-i]=o[15]>>>n&255,e=15-i+1;e<16;e++)o[e]=0;for(e=0;e<8;e++)r[e]=o[e+8];return o.slice(0,8)}function h(r,t){for(var e=0;e<8;e++)r[e]^=t[e]}function g(r,t){var e=(65535&r)+(65535&t);return(r>>16)+(t>>16)+(e>>16)<<16|65535&e}function U(r,t){return r<<t&4294967295|r>>>32-t&4294967295}function b(r){return e(function(r,t){r[t>>5]|=128<<24-t%32,r[15+(t+64>>9<<4)]=t;for(var e,o,i,n,a,f=Array(80),u=1732584193,s=-271733879,h=-1732584194,c=271733878,d=-1009589776,p=0;p<r.length;p+=16){for(var v=u,l=s,b=h,x=c,m=d,w=0;w<80;w++){f[w]=w<16?r[p+w]:U(f[w-3]^f[w-8]^f[w-14]^f[w-16],1);var y=g(g(U(u,5),(i=s,n=h,a=c,(o=w)<20?i&n|~i&a:o<40?i^n^a:o<60?i&n|i&a|n&a:i^n^a)),g(g(d,f[w]),(e=w)<20?1518500249:e<40?1859775393:e<60?-1894007588:-899497514));d=c,c=h,h=U(s,30),s=u,u=y}u=g(u,v),s=g(s,l),h=g(h,b),c=g(c,x),d=g(d,m)}return[u,s,h,c,d]}(t(r,{ibits:8,obits:32,obigendian:!0}),8*r.length),{ibits:32,ibigendian:!0})}function x(r){return e(function(r,t){function f(r,t,e,o,i,n){return g(U(g(g(t,r),g(o,n)),i),e)}function e(r,t,e,o,i,n,a){return f(t&e|~t&o,r,t,i,n,a)}function o(r,t,e,o,i,n,a){return f(t&o|e&~o,r,t,i,n,a)}function i(r,t,e,o,i,n,a){return f(t^e^o,r,t,i,n,a)}function n(r,t,e,o,i,n,a){return f(e^(t|~o),r,t,i,n,a)}r[t>>5]|=128<<t%32,r[14+(t+64>>>9<<4)]=t;for(var a=1732584193,u=-271733879,s=-1732584194,h=271733878,c=0;c<r.length;c+=16){var d=a,p=u,v=s,l=h;a=e(a,u,s,h,r[c+0],7,-680876936),h=e(h,a,u,s,r[c+1],12,-389564586),s=e(s,h,a,u,r[c+2],17,606105819),u=e(u,s,h,a,r[c+3],22,-1044525330),a=e(a,u,s,h,r[c+4],7,-176418897),h=e(h,a,u,s,r[c+5],12,1200080426),s=e(s,h,a,u,r[c+6],17,-1473231341),u=e(u,s,h,a,r[c+7],22,-45705983),a=e(a,u,s,h,r[c+8],7,1770035416),h=e(h,a,u,s,r[c+9],12,-1958414417),s=e(s,h,a,u,r[c+10],17,-42063),u=e(u,s,h,a,r[c+11],22,-1990404162),a=e(a,u,s,h,r[c+12],7,1804603682),h=e(h,a,u,s,r[c+13],12,-40341101),s=e(s,h,a,u,r[c+14],17,-1502002290),a=o(a,u=e(u,s,h,a,r[c+15],22,1236535329),s,h,r[c+1],5,-165796510),h=o(h,a,u,s,r[c+6],9,-1069501632),s=o(s,h,a,u,r[c+11],14,643717713),u=o(u,s,h,a,r[c+0],20,-373897302),a=o(a,u,s,h,r[c+5],5,-701558691),h=o(h,a,u,s,r[c+10],9,38016083),s=o(s,h,a,u,r[c+15],14,-660478335),u=o(u,s,h,a,r[c+4],20,-405537848),a=o(a,u,s,h,r[c+9],5,568446438),h=o(h,a,u,s,r[c+14],9,-1019803690),s=o(s,h,a,u,r[c+3],14,-187363961),u=o(u,s,h,a,r[c+8],20,1163531501),a=o(a,u,s,h,r[c+13],5,-1444681467),h=o(h,a,u,s,r[c+2],9,-51403784),s=o(s,h,a,u,r[c+7],14,1735328473),a=i(a,u=o(u,s,h,a,r[c+12],20,-1926607734),s,h,r[c+5],4,-378558),h=i(h,a,u,s,r[c+8],11,-2022574463),s=i(s,h,a,u,r[c+11],16,1839030562),u=i(u,s,h,a,r[c+14],23,-35309556),a=i(a,u,s,h,r[c+1],4,-1530992060),h=i(h,a,u,s,r[c+4],11,1272893353),s=i(s,h,a,u,r[c+7],16,-155497632),u=i(u,s,h,a,r[c+10],23,-1094730640),a=i(a,u,s,h,r[c+13],4,681279174),h=i(h,a,u,s,r[c+0],11,-358537222),s=i(s,h,a,u,r[c+3],16,-722521979),u=i(u,s,h,a,r[c+6],23,76029189),a=i(a,u,s,h,r[c+9],4,-640364487),h=i(h,a,u,s,r[c+12],11,-421815835),s=i(s,h,a,u,r[c+15],16,530742520),a=n(a,u=i(u,s,h,a,r[c+2],23,-995338651),s,h,r[c+0],6,-198630844),h=n(h,a,u,s,r[c+7],10,1126891415),s=n(s,h,a,u,r[c+14],15,-1416354905),u=n(u,s,h,a,r[c+5],21,-57434055),a=n(a,u,s,h,r[c+12],6,1700485571),h=n(h,a,u,s,r[c+3],10,-1894986606),s=n(s,h,a,u,r[c+10],15,-1051523),u=n(u,s,h,a,r[c+1],21,-2054922799),a=n(a,u,s,h,r[c+8],6,1873313359),h=n(h,a,u,s,r[c+15],10,-30611744),s=n(s,h,a,u,r[c+6],15,-1560198380),u=n(u,s,h,a,r[c+13],21,1309151649),a=n(a,u,s,h,r[c+4],6,-145523070),h=n(h,a,u,s,r[c+11],10,-1120210379),s=n(s,h,a,u,r[c+2],15,718787259),u=n(u,s,h,a,r[c+9],21,-343485551),a=g(a,d),u=g(u,p),s=g(s,v),h=g(h,l)}return[a,u,s,h]}(t(r,{ibits:8,obits:32,obigendian:!1}),8*r.length),{ibits:32,ibigendian:!1})}function r(r){this.mul=d(88,81,244,45,76,149,127,45),this.inc=d(20,5,123,126,247,103,129,79),this.mask=d(0,0,0,0,255,255,255,255),this.state=n(this.inc),this.next(),u(this.state,this.mask),r=p(void 0!==r?r>>>0:4294967295*Math.random()>>>0),function(r,t){for(var e=0;e<8;e++)r[e]|=t[e]}(this.state,r),this.next()}var c="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#".split(""),m=[0,68,0,84,83,82,72,0,75,76,70,65,0,63,62,69,0,1,2,3,4,5,6,7,8,9,64,0,73,66,74,71,81,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,77,0,78,67,0,0,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,79,0,80,0,0],w=256;r.prototype.next=function(){var r=n(this.state);!function(r,t){var e,o,i,n=new Array(16);for(e=0;e<16;e++)n[e]=0;for(e=0;e<8;e++){for(o=i=0;o<8;o++)i+=r[e]*t[o]+n[e+o],n[e+o]=i%w,i/=w;for(;o<16-e;o++)i+=n[e+o],n[e+o]=i%w,i/=w}for(e=0;e<8;e++)r[e]=n[e];n.slice(8,8)}(this.state,this.mul),v(this.state,this.inc);var t=n(r);s(t,18),h(t,r),s(t,27);var e=n(r);s(e,59),u(t,this.mask);var o=f(e),i=n(t);return function(r,t){if(64<t)throw new Error("ui64_rol: invalid number of bits to shift");var e,o=new Array(16);for(e=0;e<8;e++)o[e+8]=0,o[e]=r[e];var i=Math.floor(t/8),n=t%8;for(e=7-i;0<e;e--)o[e+i]=255&(o[e]<<n|o[e-1]>>>8-n);for(o[0+i]=o[0]<<n&255,e=0+i-1;0<=e;e--)o[e]=0;for(e=0;e<8;e++)r[e]=o[e];o.slice(8,8)}(i,32-o),s(t,o),h(t,i),f(t)};function y(r,t){for(var e=[],o=0;o<r;o++)e[o]=D.next()%t;return e}function A(){if(1===arguments.length&&"string"==typeof arguments[0])this.parse.apply(this,arguments);else if(1<=arguments.length&&"number"==typeof arguments[0])this.make.apply(this,arguments);else{if(1<=arguments.length)throw new Error("UUID: constructor: invalid arguments");for(var r=0;r<16;r++)this[r]=0}}var D=new r,E=0,I=0;return"undefined"!=typeof Uint8Array?A.prototype=new Uint8Array(16):Buffer?A.prototype=new Buffer(16):A.prototype=new Array(16),(A.prototype.constructor=A).prototype.make=function(r){var t,e=this;if(1===r){var o=(new Date).getTime();o!==E?I=0:I++;var i,n=p(E=o);!function(r,t){for(var e=0,o=0;o<8;o++)e+=r[o]*t,r[o]=Math.floor(e%w),e=Math.floor(e/w)}(n,1e4),v(n,d(1,178,29,210,19,129,64,0)),0<I&&v(n,p(I)),i=l(n,8),e[3]=255&i,i=l(n,8),e[2]=255&i,i=l(n,8),e[1]=255&i,i=l(n,8),e[0]=255&i,i=l(n,8),e[5]=255&i,i=l(n,8),e[4]=255&i,i=l(n,8),e[7]=255&i,i=l(n,8),e[6]=15&i;var a=y(2,255);e[8]=a[0],e[9]=a[1];var f=y(6,255);for(f[0]|=1,f[0]|=2,t=0;t<6;t++)e[10+t]=f[t]}else if(4===r){var u=y(16,255);for(t=0;t<16;t++)this[t]=u[t]}else{if(3!==r&&5!==r)throw new Error("UUID: make: invalid version");var s="",h="object"==typeof arguments[1]&&arguments[1]instanceof A?arguments[1]:(new A).parse(arguments[1]);for(t=0;t<16;t++)s+=String.fromCharCode(h[t]);s+=arguments[2];var c=3===r?x(s):b(s);for(t=0;t<16;t++)e[t]=c.charCodeAt(t)}return e[6]&=15,e[6]|=r<<4,e[8]&=63,e[8]|=128,e},A.prototype.format=function(r){var t,e;return"z85"===r?t=function(r,t){if(t%4!=0)throw new Error("z85_encode: invalid input length (multiple of 4 expected)");for(var e="",o=0,i=0;o<t;)if(i=256*i+r[o++],o%4==0){for(var n=52200625;1<=n;){var a=Math.floor(i/n)%85;e+=c[a],n/=85}i=0}return e}(this,16):"b16"===r?(e=Array(32),o(this,0,15,!0,e,0),t=e.join("")):void 0!==r&&"std"!==r||(e=new Array(36),o(this,0,3,!1,e,0),e[8]="-",o(this,4,5,!1,e,9),e[13]="-",o(this,6,7,!1,e,14),e[18]="-",o(this,8,9,!1,e,19),e[23]="-",o(this,10,15,!1,e,24),t=e.join("")),t},A.prototype.toString=function(r){return this.format(r)},A.prototype.parse=function(r,t){if("string"!=typeof r)throw new Error("UUID: parse: invalid argument (type string expected)");if("z85"===t)!function(r,t){var e=r.length;if(e%5!=0)throw new Error("z85_decode: invalid input length (multiple of 5 expected)");void 0===t&&(t=new Array(4*e/5));for(var o=0,i=0,n=0;o<e;){var a=r.charCodeAt(o++)-32;if(a<0||m.length<=a)break;if(n=85*n+m[a],o%5==0){for(var f=16777216;1<=f;)t[i++]=Math.trunc(n/f%256),f/=256;n=0}}}(r,this);else if("b16"===t)i(r,0,35,this,0);else if(void 0===t||"std"===t){var e={nil:"00000000-0000-0000-0000-000000000000","ns:DNS":"6ba7b810-9dad-11d1-80b4-00c04fd430c8","ns:URL":"6ba7b811-9dad-11d1-80b4-00c04fd430c8","ns:OID":"6ba7b812-9dad-11d1-80b4-00c04fd430c8","ns:X500":"6ba7b814-9dad-11d1-80b4-00c04fd430c8"};if(void 0!==e[r])r=e[r];else if(!r.match(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/))throw new Error('UUID: parse: invalid string representation (expected "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")');i(r,0,7,this,0),i(r,9,12,this,4),i(r,14,17,this,6),i(r,19,22,this,8),i(r,24,35,this,10)}return this},A.prototype.export=function(){for(var r=Array(16),t=0;t<16;t++)r[t]=this[t];return r},A.prototype.import=function(r){if(!("object"==typeof r&&r instanceof Array))throw new Error("UUID: import: invalid argument (type Array expected)");if(16!==r.length)throw new Error("UUID: import: invalid argument (Array of length 16 expected)");for(var t=0;t<16;t++){if("number"!=typeof r[t])throw new Error("UUID: import: invalid array element #"+t+" (type Number expected)");if(!isFinite(r[t])||Math.floor(r[t])!==r[t])throw new Error("UUID: import: invalid array element #"+t+" (Number with integer value expected)");if(!(0<=r[t]&&r[t]<=255))throw new Error("UUID: import: invalid array element #"+t+" (Number with integer value in range 0...255 expected)");this[t]=r[t]}return this},A.prototype.compare=function(r){if("object"!=typeof r)throw new Error("UUID: compare: invalid argument (type UUID expected)");if(!(r instanceof A))throw new Error("UUID: compare: invalid argument (type UUID expected)");for(var t=0;t<16;t++){if(this[t]<r[t])return-1;if(this[t]>r[t])return 1}return 0},A.prototype.fold=function(r){if(void 0===r)throw new Error("UUID: fold: invalid argument (number of fold operations expected)");if(r<1||4<r)throw new Error("UUID: fold: invalid argument (1-4 fold operations expected)");for(var t=16/Math.pow(2,r),e=new Array(t),o=0;o<t;o++){for(var i=0,n=0;o+n<16;n+=t)i^=this[o+n];e[o]=i}return e},A.PCG=r,A});

@@ -25,7 +25,2 @@ /*

/* global require: true */
/* global global: true */
/* global describe: true */
/* global it: true */
/* global expect: true */
/* jshint -W030: false */

@@ -32,0 +27,0 @@ /* eslint no-unused-expressions: 0 */

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc