uuid 8.1.0 → 8.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +23 -15
  2. package/CONTRIBUTING.md +2 -4
  3. package/LICENSE.md +3 -15
  4. package/README.md +222 -200
  5. package/dist/esm-browser/index.js +6 -1
  6. package/dist/esm-browser/nil.js +1 -0
  7. package/dist/esm-browser/parse.js +35 -0
  8. package/dist/esm-browser/regex.js +1 -0
  9. package/dist/esm-browser/sha1.js +3 -0
  10. package/dist/esm-browser/stringify.js +30 -0
  11. package/dist/esm-browser/v1.js +3 -3
  12. package/dist/esm-browser/v35.js +23 -22
  13. package/dist/esm-browser/v4.js +4 -9
  14. package/dist/esm-browser/validate.js +7 -0
  15. package/dist/esm-browser/version.js +11 -0
  16. package/dist/esm-node/index.js +6 -1
  17. package/dist/esm-node/nil.js +1 -0
  18. package/dist/esm-node/parse.js +35 -0
  19. package/dist/esm-node/regex.js +1 -0
  20. package/dist/esm-node/stringify.js +29 -0
  21. package/dist/esm-node/v1.js +3 -3
  22. package/dist/esm-node/v35.js +23 -22
  23. package/dist/esm-node/v4.js +4 -9
  24. package/dist/esm-node/validate.js +7 -0
  25. package/dist/esm-node/version.js +11 -0
  26. package/dist/index.js +40 -0
  27. package/dist/nil.js +8 -0
  28. package/dist/parse.js +45 -0
  29. package/dist/regex.js +8 -0
  30. package/dist/sha1-browser.js +3 -0
  31. package/dist/stringify.js +39 -0
  32. package/dist/umd/uuid.min.js +1 -1
  33. package/dist/umd/uuidNIL.min.js +1 -0
  34. package/dist/umd/uuidParse.min.js +1 -0
  35. package/dist/umd/uuidStringify.min.js +1 -0
  36. package/dist/umd/uuidValidate.min.js +1 -0
  37. package/dist/umd/uuidVersion.min.js +1 -0
  38. package/dist/umd/uuidv1.min.js +1 -1
  39. package/dist/umd/uuidv3.min.js +1 -1
  40. package/dist/umd/uuidv4.min.js +1 -1
  41. package/dist/umd/uuidv5.min.js +1 -1
  42. package/dist/uuid-bin.js +18 -4
  43. package/dist/v1.js +3 -3
  44. package/dist/v35.js +24 -22
  45. package/dist/v4.js +4 -9
  46. package/dist/validate.js +17 -0
  47. package/dist/version.js +21 -0
  48. package/package.json +34 -29
  49. package/wrapper.mjs +5 -0
  50. package/dist/bytesToUuid.js +0 -27
  51. package/dist/esm-browser/bytesToUuid.js +0 -19
  52. package/dist/esm-node/bytesToUuid.js +0 -19
@@ -1 +1 @@
1
- !function(r,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((r=r||self).uuid={})}(this,(function(r){"use strict";var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),e=new Uint8Array(16);function t(){if(!n)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(e)}for(var o,a,u=[],f=0;f<256;++f)u.push((f+256).toString(16).substr(1));function c(r,n){var e=n||0,t=u;return(t[r[e+0]]+t[r[e+1]]+t[r[e+2]]+t[r[e+3]]+"-"+t[r[e+4]]+t[r[e+5]]+"-"+t[r[e+6]]+t[r[e+7]]+"-"+t[r[e+8]]+t[r[e+9]]+"-"+t[r[e+10]]+t[r[e+11]]+t[r[e+12]]+t[r[e+13]]+t[r[e+14]]+t[r[e+15]]).toLowerCase()}var i=0,s=0;function v(r,n,e){function t(r,t,o,a){var u=o&&a||0;if("string"==typeof r&&(r=function(r){r=unescape(encodeURIComponent(r));for(var n=[],e=0;e<r.length;++e)n.push(r.charCodeAt(e));return n}(r)),"string"==typeof t&&(t=function(r){var n=[];return r.replace(/[a-fA-F0-9]{2}/g,(function(r){n.push(parseInt(r,16))})),n}(t)),!Array.isArray(r))throw TypeError("value must be an array of bytes");if(!Array.isArray(t)||16!==t.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var f=e(t.concat(r));if(f[6]=15&f[6]|n,f[8]=63&f[8]|128,o)for(var i=0;i<16;++i)o[u+i]=f[i];return o||c(f)}try{t.name=r}catch(r){}return t.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",t.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",t}function d(r){return 14+(r+64>>>9<<4)+1}function p(r,n){var e=(65535&r)+(65535&n);return(r>>16)+(n>>16)+(e>>16)<<16|65535&e}function l(r,n,e,t,o,a){return p((u=p(p(n,r),p(t,a)))<<(f=o)|u>>>32-f,e);var u,f}function y(r,n,e,t,o,a,u){return l(n&e|~n&t,r,n,o,a,u)}function h(r,n,e,t,o,a,u){return l(n&t|e&~t,r,n,o,a,u)}function g(r,n,e,t,o,a,u){return l(n^e^t,r,n,o,a,u)}function m(r,n,e,t,o,a,u){return l(e^(n|~t),r,n,o,a,u)}var b=v("v3",48,(function(r){if("string"==typeof r){var n=unescape(encodeURIComponent(r));r=new Uint8Array(n.length);for(var e=0;e<n.length;++e)r[e]=n.charCodeAt(e)}return function(r){for(var n=[],e=32*r.length,t=0;t<e;t+=8){var o=r[t>>5]>>>t%32&255,a=parseInt("0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o),16);n.push(a)}return n}(function(r,n){r[n>>5]|=128<<n%32,r[d(n)-1]=n;for(var e=1732584193,t=-271733879,o=-1732584194,a=271733878,u=0;u<r.length;u+=16){var f=e,c=t,i=o,s=a;e=y(e,t,o,a,r[u],7,-680876936),a=y(a,e,t,o,r[u+1],12,-389564586),o=y(o,a,e,t,r[u+2],17,606105819),t=y(t,o,a,e,r[u+3],22,-1044525330),e=y(e,t,o,a,r[u+4],7,-176418897),a=y(a,e,t,o,r[u+5],12,1200080426),o=y(o,a,e,t,r[u+6],17,-1473231341),t=y(t,o,a,e,r[u+7],22,-45705983),e=y(e,t,o,a,r[u+8],7,1770035416),a=y(a,e,t,o,r[u+9],12,-1958414417),o=y(o,a,e,t,r[u+10],17,-42063),t=y(t,o,a,e,r[u+11],22,-1990404162),e=y(e,t,o,a,r[u+12],7,1804603682),a=y(a,e,t,o,r[u+13],12,-40341101),o=y(o,a,e,t,r[u+14],17,-1502002290),t=y(t,o,a,e,r[u+15],22,1236535329),e=h(e,t,o,a,r[u+1],5,-165796510),a=h(a,e,t,o,r[u+6],9,-1069501632),o=h(o,a,e,t,r[u+11],14,643717713),t=h(t,o,a,e,r[u],20,-373897302),e=h(e,t,o,a,r[u+5],5,-701558691),a=h(a,e,t,o,r[u+10],9,38016083),o=h(o,a,e,t,r[u+15],14,-660478335),t=h(t,o,a,e,r[u+4],20,-405537848),e=h(e,t,o,a,r[u+9],5,568446438),a=h(a,e,t,o,r[u+14],9,-1019803690),o=h(o,a,e,t,r[u+3],14,-187363961),t=h(t,o,a,e,r[u+8],20,1163531501),e=h(e,t,o,a,r[u+13],5,-1444681467),a=h(a,e,t,o,r[u+2],9,-51403784),o=h(o,a,e,t,r[u+7],14,1735328473),t=h(t,o,a,e,r[u+12],20,-1926607734),e=g(e,t,o,a,r[u+5],4,-378558),a=g(a,e,t,o,r[u+8],11,-2022574463),o=g(o,a,e,t,r[u+11],16,1839030562),t=g(t,o,a,e,r[u+14],23,-35309556),e=g(e,t,o,a,r[u+1],4,-1530992060),a=g(a,e,t,o,r[u+4],11,1272893353),o=g(o,a,e,t,r[u+7],16,-155497632),t=g(t,o,a,e,r[u+10],23,-1094730640),e=g(e,t,o,a,r[u+13],4,681279174),a=g(a,e,t,o,r[u],11,-358537222),o=g(o,a,e,t,r[u+3],16,-722521979),t=g(t,o,a,e,r[u+6],23,76029189),e=g(e,t,o,a,r[u+9],4,-640364487),a=g(a,e,t,o,r[u+12],11,-421815835),o=g(o,a,e,t,r[u+15],16,530742520),t=g(t,o,a,e,r[u+2],23,-995338651),e=m(e,t,o,a,r[u],6,-198630844),a=m(a,e,t,o,r[u+7],10,1126891415),o=m(o,a,e,t,r[u+14],15,-1416354905),t=m(t,o,a,e,r[u+5],21,-57434055),e=m(e,t,o,a,r[u+12],6,1700485571),a=m(a,e,t,o,r[u+3],10,-1894986606),o=m(o,a,e,t,r[u+10],15,-1051523),t=m(t,o,a,e,r[u+1],21,-2054922799),e=m(e,t,o,a,r[u+8],6,1873313359),a=m(a,e,t,o,r[u+15],10,-30611744),o=m(o,a,e,t,r[u+6],15,-1560198380),t=m(t,o,a,e,r[u+13],21,1309151649),e=m(e,t,o,a,r[u+4],6,-145523070),a=m(a,e,t,o,r[u+11],10,-1120210379),o=m(o,a,e,t,r[u+2],15,718787259),t=m(t,o,a,e,r[u+9],21,-343485551),e=p(e,f),t=p(t,c),o=p(o,i),a=p(a,s)}return[e,t,o,a]}(function(r){if(0===r.length)return[];for(var n=8*r.length,e=new Uint32Array(d(n)),t=0;t<n;t+=8)e[t>>5]|=(255&r[t/8])<<t%32;return e}(r),8*r.length))}));function A(r,n,e,t){switch(r){case 0:return n&e^~n&t;case 1:return n^e^t;case 2:return n&e^n&t^e&t;case 3:return n^e^t}}function w(r,n){return r<<n|r>>>32-n}var C=v("v5",80,(function(r){var n=[1518500249,1859775393,2400959708,3395469782],e=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof r){var t=unescape(encodeURIComponent(r));r=[];for(var o=0;o<t.length;++o)r.push(t.charCodeAt(o))}r.push(128);for(var a=r.length/4+2,u=Math.ceil(a/16),f=new Array(u),c=0;c<u;++c){for(var i=new Uint32Array(16),s=0;s<16;++s)i[s]=r[64*c+4*s]<<24|r[64*c+4*s+1]<<16|r[64*c+4*s+2]<<8|r[64*c+4*s+3];f[c]=i}f[u-1][14]=8*(r.length-1)/Math.pow(2,32),f[u-1][14]=Math.floor(f[u-1][14]),f[u-1][15]=8*(r.length-1)&4294967295;for(var v=0;v<u;++v){for(var d=new Uint32Array(80),p=0;p<16;++p)d[p]=f[v][p];for(var l=16;l<80;++l)d[l]=w(d[l-3]^d[l-8]^d[l-14]^d[l-16],1);for(var y=e[0],h=e[1],g=e[2],m=e[3],b=e[4],C=0;C<80;++C){var U=Math.floor(C/20),R=w(y,5)+A(U,h,g,m)+b+n[U]+d[C]>>>0;b=m,m=g,g=w(h,30)>>>0,h=y,y=R}e[0]=e[0]+y>>>0,e[1]=e[1]+h>>>0,e[2]=e[2]+g>>>0,e[3]=e[3]+m>>>0,e[4]=e[4]+b>>>0}return[e[0]>>24&255,e[0]>>16&255,e[0]>>8&255,255&e[0],e[1]>>24&255,e[1]>>16&255,e[1]>>8&255,255&e[1],e[2]>>24&255,e[2]>>16&255,e[2]>>8&255,255&e[2],e[3]>>24&255,e[3]>>16&255,e[3]>>8&255,255&e[3],e[4]>>24&255,e[4]>>16&255,e[4]>>8&255,255&e[4]]}));r.v1=function(r,n,e){var u=n&&e||0,f=n||[],v=(r=r||{}).node||o,d=void 0!==r.clockseq?r.clockseq:a;if(null==v||null==d){var p=r.random||(r.rng||t)();null==v&&(v=o=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==d&&(d=a=16383&(p[6]<<8|p[7]))}var l=void 0!==r.msecs?r.msecs:Date.now(),y=void 0!==r.nsecs?r.nsecs:s+1,h=l-i+(y-s)/1e4;if(h<0&&void 0===r.clockseq&&(d=d+1&16383),(h<0||l>i)&&void 0===r.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");i=l,s=y,a=d;var g=(1e4*(268435455&(l+=122192928e5))+y)%4294967296;f[u++]=g>>>24&255,f[u++]=g>>>16&255,f[u++]=g>>>8&255,f[u++]=255&g;var m=l/4294967296*1e4&268435455;f[u++]=m>>>8&255,f[u++]=255&m,f[u++]=m>>>24&15|16,f[u++]=m>>>16&255,f[u++]=d>>>8|128,f[u++]=255&d;for(var b=0;b<6;++b)f[u+b]=v[b];return n||c(f)},r.v3=b,r.v4=function(r,n,e){"string"==typeof r&&(n="binary"===r?new Uint8Array(16):null,r=null);var o=(r=r||{}).random||(r.rng||t)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,n){for(var a=e||0,u=0;u<16;++u)n[a+u]=o[u];return n}return c(o)},r.v5=C,Object.defineProperty(r,"__esModule",{value:!0})}));
1
+ !function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((r=r||self).uuid={})}(this,(function(r){"use strict";var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),n=new Uint8Array(16);function t(){if(!e)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(n)}var o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function a(r){return"string"==typeof r&&o.test(r)}for(var i,u,f=[],s=0;s<256;++s)f.push((s+256).toString(16).substr(1));function c(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(f[r[e+0]]+f[r[e+1]]+f[r[e+2]]+f[r[e+3]]+"-"+f[r[e+4]]+f[r[e+5]]+"-"+f[r[e+6]]+f[r[e+7]]+"-"+f[r[e+8]]+f[r[e+9]]+"-"+f[r[e+10]]+f[r[e+11]]+f[r[e+12]]+f[r[e+13]]+f[r[e+14]]+f[r[e+15]]).toLowerCase();if(!a(n))throw TypeError("Stringified UUID is invalid");return n}var v=0,d=0;function l(r){if(!a(r))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(r.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(r.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(r.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(r.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(r.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}function p(r,e,n){function t(r,t,o,a){if("string"==typeof r&&(r=function(r){r=unescape(encodeURIComponent(r));for(var e=[],n=0;n<r.length;++n)e.push(r.charCodeAt(n));return e}(r)),"string"==typeof t&&(t=l(t)),16!==t.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+r.length);if(i.set(t),i.set(r,t.length),(i=n(i))[6]=15&i[6]|e,i[8]=63&i[8]|128,o){a=a||0;for(var u=0;u<16;++u)o[a+u]=i[u];return o}return c(i)}try{t.name=r}catch(r){}return t.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",t.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",t}function h(r){return 14+(r+64>>>9<<4)+1}function y(r,e){var n=(65535&r)+(65535&e);return(r>>16)+(e>>16)+(n>>16)<<16|65535&n}function g(r,e,n,t,o,a){return y((i=y(y(e,r),y(t,a)))<<(u=o)|i>>>32-u,n);var i,u}function m(r,e,n,t,o,a,i){return g(e&n|~e&t,r,e,o,a,i)}function w(r,e,n,t,o,a,i){return g(e&t|n&~t,r,e,o,a,i)}function b(r,e,n,t,o,a,i){return g(e^n^t,r,e,o,a,i)}function A(r,e,n,t,o,a,i){return g(n^(e|~t),r,e,o,a,i)}var U=p("v3",48,(function(r){if("string"==typeof r){var e=unescape(encodeURIComponent(r));r=new Uint8Array(e.length);for(var n=0;n<e.length;++n)r[n]=e.charCodeAt(n)}return function(r){for(var e=[],n=32*r.length,t=0;t<n;t+=8){var o=r[t>>5]>>>t%32&255,a=parseInt("0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o),16);e.push(a)}return e}(function(r,e){r[e>>5]|=128<<e%32,r[h(e)-1]=e;for(var n=1732584193,t=-271733879,o=-1732584194,a=271733878,i=0;i<r.length;i+=16){var u=n,f=t,s=o,c=a;n=m(n,t,o,a,r[i],7,-680876936),a=m(a,n,t,o,r[i+1],12,-389564586),o=m(o,a,n,t,r[i+2],17,606105819),t=m(t,o,a,n,r[i+3],22,-1044525330),n=m(n,t,o,a,r[i+4],7,-176418897),a=m(a,n,t,o,r[i+5],12,1200080426),o=m(o,a,n,t,r[i+6],17,-1473231341),t=m(t,o,a,n,r[i+7],22,-45705983),n=m(n,t,o,a,r[i+8],7,1770035416),a=m(a,n,t,o,r[i+9],12,-1958414417),o=m(o,a,n,t,r[i+10],17,-42063),t=m(t,o,a,n,r[i+11],22,-1990404162),n=m(n,t,o,a,r[i+12],7,1804603682),a=m(a,n,t,o,r[i+13],12,-40341101),o=m(o,a,n,t,r[i+14],17,-1502002290),t=m(t,o,a,n,r[i+15],22,1236535329),n=w(n,t,o,a,r[i+1],5,-165796510),a=w(a,n,t,o,r[i+6],9,-1069501632),o=w(o,a,n,t,r[i+11],14,643717713),t=w(t,o,a,n,r[i],20,-373897302),n=w(n,t,o,a,r[i+5],5,-701558691),a=w(a,n,t,o,r[i+10],9,38016083),o=w(o,a,n,t,r[i+15],14,-660478335),t=w(t,o,a,n,r[i+4],20,-405537848),n=w(n,t,o,a,r[i+9],5,568446438),a=w(a,n,t,o,r[i+14],9,-1019803690),o=w(o,a,n,t,r[i+3],14,-187363961),t=w(t,o,a,n,r[i+8],20,1163531501),n=w(n,t,o,a,r[i+13],5,-1444681467),a=w(a,n,t,o,r[i+2],9,-51403784),o=w(o,a,n,t,r[i+7],14,1735328473),t=w(t,o,a,n,r[i+12],20,-1926607734),n=b(n,t,o,a,r[i+5],4,-378558),a=b(a,n,t,o,r[i+8],11,-2022574463),o=b(o,a,n,t,r[i+11],16,1839030562),t=b(t,o,a,n,r[i+14],23,-35309556),n=b(n,t,o,a,r[i+1],4,-1530992060),a=b(a,n,t,o,r[i+4],11,1272893353),o=b(o,a,n,t,r[i+7],16,-155497632),t=b(t,o,a,n,r[i+10],23,-1094730640),n=b(n,t,o,a,r[i+13],4,681279174),a=b(a,n,t,o,r[i],11,-358537222),o=b(o,a,n,t,r[i+3],16,-722521979),t=b(t,o,a,n,r[i+6],23,76029189),n=b(n,t,o,a,r[i+9],4,-640364487),a=b(a,n,t,o,r[i+12],11,-421815835),o=b(o,a,n,t,r[i+15],16,530742520),t=b(t,o,a,n,r[i+2],23,-995338651),n=A(n,t,o,a,r[i],6,-198630844),a=A(a,n,t,o,r[i+7],10,1126891415),o=A(o,a,n,t,r[i+14],15,-1416354905),t=A(t,o,a,n,r[i+5],21,-57434055),n=A(n,t,o,a,r[i+12],6,1700485571),a=A(a,n,t,o,r[i+3],10,-1894986606),o=A(o,a,n,t,r[i+10],15,-1051523),t=A(t,o,a,n,r[i+1],21,-2054922799),n=A(n,t,o,a,r[i+8],6,1873313359),a=A(a,n,t,o,r[i+15],10,-30611744),o=A(o,a,n,t,r[i+6],15,-1560198380),t=A(t,o,a,n,r[i+13],21,1309151649),n=A(n,t,o,a,r[i+4],6,-145523070),a=A(a,n,t,o,r[i+11],10,-1120210379),o=A(o,a,n,t,r[i+2],15,718787259),t=A(t,o,a,n,r[i+9],21,-343485551),n=y(n,u),t=y(t,f),o=y(o,s),a=y(a,c)}return[n,t,o,a]}(function(r){if(0===r.length)return[];for(var e=8*r.length,n=new Uint32Array(h(e)),t=0;t<e;t+=8)n[t>>5]|=(255&r[t/8])<<t%32;return n}(r),8*r.length))}));function I(r,e,n,t){switch(r){case 0:return e&n^~e&t;case 1:return e^n^t;case 2:return e&n^e&t^n&t;case 3:return e^n^t}}function C(r,e){return r<<e|r>>>32-e}var R=p("v5",80,(function(r){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof r){var t=unescape(encodeURIComponent(r));r=[];for(var o=0;o<t.length;++o)r.push(t.charCodeAt(o))}else Array.isArray(r)||(r=Array.prototype.slice.call(r));r.push(128);for(var a=r.length/4+2,i=Math.ceil(a/16),u=new Array(i),f=0;f<i;++f){for(var s=new Uint32Array(16),c=0;c<16;++c)s[c]=r[64*f+4*c]<<24|r[64*f+4*c+1]<<16|r[64*f+4*c+2]<<8|r[64*f+4*c+3];u[f]=s}u[i-1][14]=8*(r.length-1)/Math.pow(2,32),u[i-1][14]=Math.floor(u[i-1][14]),u[i-1][15]=8*(r.length-1)&4294967295;for(var v=0;v<i;++v){for(var d=new Uint32Array(80),l=0;l<16;++l)d[l]=u[v][l];for(var p=16;p<80;++p)d[p]=C(d[p-3]^d[p-8]^d[p-14]^d[p-16],1);for(var h=n[0],y=n[1],g=n[2],m=n[3],w=n[4],b=0;b<80;++b){var A=Math.floor(b/20),U=C(h,5)+I(A,y,g,m)+w+e[A]+d[b]>>>0;w=m,m=g,g=C(y,30)>>>0,y=h,h=U}n[0]=n[0]+h>>>0,n[1]=n[1]+y>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+m>>>0,n[4]=n[4]+w>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));r.NIL="00000000-0000-0000-0000-000000000000",r.parse=l,r.stringify=c,r.v1=function(r,e,n){var o=e&&n||0,a=e||new Array(16),f=(r=r||{}).node||i,s=void 0!==r.clockseq?r.clockseq:u;if(null==f||null==s){var l=r.random||(r.rng||t)();null==f&&(f=i=[1|l[0],l[1],l[2],l[3],l[4],l[5]]),null==s&&(s=u=16383&(l[6]<<8|l[7]))}var p=void 0!==r.msecs?r.msecs:Date.now(),h=void 0!==r.nsecs?r.nsecs:d+1,y=p-v+(h-d)/1e4;if(y<0&&void 0===r.clockseq&&(s=s+1&16383),(y<0||p>v)&&void 0===r.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");v=p,d=h,u=s;var g=(1e4*(268435455&(p+=122192928e5))+h)%4294967296;a[o++]=g>>>24&255,a[o++]=g>>>16&255,a[o++]=g>>>8&255,a[o++]=255&g;var m=p/4294967296*1e4&268435455;a[o++]=m>>>8&255,a[o++]=255&m,a[o++]=m>>>24&15|16,a[o++]=m>>>16&255,a[o++]=s>>>8|128,a[o++]=255&s;for(var w=0;w<6;++w)a[o+w]=f[w];return e||c(a)},r.v3=U,r.v4=function(r,e,n){var o=(r=r||{}).random||(r.rng||t)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){n=n||0;for(var a=0;a<16;++a)e[n+a]=o[a];return e}return c(o)},r.v5=R,r.validate=a,r.version=function(r){if(!a(r))throw TypeError("Invalid UUID");return parseInt(r.substr(14,1),16)},Object.defineProperty(r,"__esModule",{value:!0})}));
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).uuidNIL=t()}(this,(function(){"use strict";return"00000000-0000-0000-0000-000000000000"}));
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).uuidParse=t()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return function(t){if(!function(t){return"string"==typeof t&&e.test(t)}(t))throw TypeError("Invalid UUID");var n,r=new Uint8Array(16);return r[0]=(n=parseInt(t.slice(0,8),16))>>>24,r[1]=n>>>16&255,r[2]=n>>>8&255,r[3]=255&n,r[4]=(n=parseInt(t.slice(9,13),16))>>>8,r[5]=255&n,r[6]=(n=parseInt(t.slice(14,18),16))>>>8,r[7]=255&n,r[8]=(n=parseInt(t.slice(19,23),16))>>>8,r[9]=255&n,r[10]=(n=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=n/4294967296&255,r[12]=n>>>24&255,r[13]=n>>>16&255,r[14]=n>>>8&255,r[15]=255&n,r}}));
@@ -0,0 +1 @@
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).uuidStringify=e()}(this,(function(){"use strict";var t=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function e(e){return"string"==typeof e&&t.test(e)}for(var i=[],n=0;n<256;++n)i.push((n+256).toString(16).substr(1));return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,f=(i[t[n+0]]+i[t[n+1]]+i[t[n+2]]+i[t[n+3]]+"-"+i[t[n+4]]+i[t[n+5]]+"-"+i[t[n+6]]+i[t[n+7]]+"-"+i[t[n+8]]+i[t[n+9]]+"-"+i[t[n+10]]+i[t[n+11]]+i[t[n+12]]+i[t[n+13]]+i[t[n+14]]+i[t[n+15]]).toLowerCase();if(!e(f))throw TypeError("Stringified UUID is invalid");return f}}));
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).uuidValidate=t()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return function(t){return"string"==typeof t&&e.test(t)}}));
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).uuidVersion=t()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return function(t){if(!function(t){return"string"==typeof t&&e.test(t)}(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}}));
@@ -1 +1 @@
1
- !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e=e||self).uuidv1=o()}(this,(function(){"use strict";var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),o=new Uint8Array(16);function t(){if(!e)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(o)}for(var n,r,u=[],s=0;s<256;++s)u.push((s+256).toString(16).substr(1));var d=0,i=0;return function(e,o,s){var a=o&&s||0,c=o||[],f=(e=e||{}).node||n,p=void 0!==e.clockseq?e.clockseq:r;if(null==f||null==p){var l=e.random||(e.rng||t)();null==f&&(f=n=[1|l[0],l[1],l[2],l[3],l[4],l[5]]),null==p&&(p=r=16383&(l[6]<<8|l[7]))}var m=void 0!==e.msecs?e.msecs:Date.now(),v=void 0!==e.nsecs?e.nsecs:i+1,y=m-d+(v-i)/1e4;if(y<0&&void 0===e.clockseq&&(p=p+1&16383),(y<0||m>d)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=m,i=v,r=p;var g=(1e4*(268435455&(m+=122192928e5))+v)%4294967296;c[a++]=g>>>24&255,c[a++]=g>>>16&255,c[a++]=g>>>8&255,c[a++]=255&g;var h=m/4294967296*1e4&268435455;c[a++]=h>>>8&255,c[a++]=255&h,c[a++]=h>>>24&15|16,c[a++]=h>>>16&255,c[a++]=p>>>8|128,c[a++]=255&p;for(var w=0;w<6;++w)c[a+w]=f[w];return o||function(e,o){var t=o||0,n=u;return(n[e[t+0]]+n[e[t+1]]+n[e[t+2]]+n[e[t+3]]+"-"+n[e[t+4]]+n[e[t+5]]+"-"+n[e[t+6]]+n[e[t+7]]+"-"+n[e[t+8]]+n[e[t+9]]+"-"+n[e[t+10]]+n[e[t+11]]+n[e[t+12]]+n[e[t+13]]+n[e[t+14]]+n[e[t+15]]).toLowerCase()}(c)}}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).uuidv1=t()}(this,(function(){"use strict";var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),t=new Uint8Array(16);function o(){if(!e)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(t)}var n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function r(e){return"string"==typeof e&&n.test(e)}for(var i,u,s=[],a=0;a<256;++a)s.push((a+256).toString(16).substr(1));var d=0,f=0;return function(e,t,n){var a=t&&n||0,c=t||new Array(16),p=(e=e||{}).node||i,l=void 0!==e.clockseq?e.clockseq:u;if(null==p||null==l){var v=e.random||(e.rng||o)();null==p&&(p=i=[1|v[0],v[1],v[2],v[3],v[4],v[5]]),null==l&&(l=u=16383&(v[6]<<8|v[7]))}var y=void 0!==e.msecs?e.msecs:Date.now(),m=void 0!==e.nsecs?e.nsecs:f+1,g=y-d+(m-f)/1e4;if(g<0&&void 0===e.clockseq&&(l=l+1&16383),(g<0||y>d)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=y,f=m,u=l;var h=(1e4*(268435455&(y+=122192928e5))+m)%4294967296;c[a++]=h>>>24&255,c[a++]=h>>>16&255,c[a++]=h>>>8&255,c[a++]=255&h;var w=y/4294967296*1e4&268435455;c[a++]=w>>>8&255,c[a++]=255&w,c[a++]=w>>>24&15|16,c[a++]=w>>>16&255,c[a++]=l>>>8|128,c[a++]=255&l;for(var b=0;b<6;++b)c[a+b]=p[b];return t||function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]).toLowerCase();if(!r(o))throw TypeError("Stringified UUID is invalid");return o}(c)}}));
@@ -1 +1 @@
1
- !function(r,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(r=r||self).uuidv3=n()}(this,(function(){"use strict";for(var r=[],n=0;n<256;++n)r.push((n+256).toString(16).substr(1));function t(r){return 14+(r+64>>>9<<4)+1}function e(r,n){var t=(65535&r)+(65535&n);return(r>>16)+(n>>16)+(t>>16)<<16|65535&t}function o(r,n,t,o,u,a){return e((f=e(e(n,r),e(o,a)))<<(c=u)|f>>>32-c,t);var f,c}function u(r,n,t,e,u,a,f){return o(n&t|~n&e,r,n,u,a,f)}function a(r,n,t,e,u,a,f){return o(n&e|t&~e,r,n,u,a,f)}function f(r,n,t,e,u,a,f){return o(n^t^e,r,n,u,a,f)}function c(r,n,t,e,u,a,f){return o(t^(n|~e),r,n,u,a,f)}return function(n,t,e){function o(n,o,u,a){var f=u&&a||0;if("string"==typeof n&&(n=function(r){r=unescape(encodeURIComponent(r));for(var n=[],t=0;t<r.length;++t)n.push(r.charCodeAt(t));return n}(n)),"string"==typeof o&&(o=function(r){var n=[];return r.replace(/[a-fA-F0-9]{2}/g,(function(r){n.push(parseInt(r,16))})),n}(o)),!Array.isArray(n))throw TypeError("value must be an array of bytes");if(!Array.isArray(o)||16!==o.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var c=e(o.concat(n));if(c[6]=15&c[6]|t,c[8]=63&c[8]|128,u)for(var i=0;i<16;++i)u[f+i]=c[i];return u||function(n,t){var e=t||0,o=r;return(o[n[e+0]]+o[n[e+1]]+o[n[e+2]]+o[n[e+3]]+"-"+o[n[e+4]]+o[n[e+5]]+"-"+o[n[e+6]]+o[n[e+7]]+"-"+o[n[e+8]]+o[n[e+9]]+"-"+o[n[e+10]]+o[n[e+11]]+o[n[e+12]]+o[n[e+13]]+o[n[e+14]]+o[n[e+15]]).toLowerCase()}(c)}try{o.name=n}catch(r){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}("v3",48,(function(r){if("string"==typeof r){var n=unescape(encodeURIComponent(r));r=new Uint8Array(n.length);for(var o=0;o<n.length;++o)r[o]=n.charCodeAt(o)}return function(r){for(var n=[],t=32*r.length,e=0;e<t;e+=8){var o=r[e>>5]>>>e%32&255,u=parseInt("0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o),16);n.push(u)}return n}(function(r,n){r[n>>5]|=128<<n%32,r[t(n)-1]=n;for(var o=1732584193,i=-271733879,s=-1732584194,d=271733878,p=0;p<r.length;p+=16){var h=o,v=i,y=s,g=d;o=u(o,i,s,d,r[p],7,-680876936),d=u(d,o,i,s,r[p+1],12,-389564586),s=u(s,d,o,i,r[p+2],17,606105819),i=u(i,s,d,o,r[p+3],22,-1044525330),o=u(o,i,s,d,r[p+4],7,-176418897),d=u(d,o,i,s,r[p+5],12,1200080426),s=u(s,d,o,i,r[p+6],17,-1473231341),i=u(i,s,d,o,r[p+7],22,-45705983),o=u(o,i,s,d,r[p+8],7,1770035416),d=u(d,o,i,s,r[p+9],12,-1958414417),s=u(s,d,o,i,r[p+10],17,-42063),i=u(i,s,d,o,r[p+11],22,-1990404162),o=u(o,i,s,d,r[p+12],7,1804603682),d=u(d,o,i,s,r[p+13],12,-40341101),s=u(s,d,o,i,r[p+14],17,-1502002290),i=u(i,s,d,o,r[p+15],22,1236535329),o=a(o,i,s,d,r[p+1],5,-165796510),d=a(d,o,i,s,r[p+6],9,-1069501632),s=a(s,d,o,i,r[p+11],14,643717713),i=a(i,s,d,o,r[p],20,-373897302),o=a(o,i,s,d,r[p+5],5,-701558691),d=a(d,o,i,s,r[p+10],9,38016083),s=a(s,d,o,i,r[p+15],14,-660478335),i=a(i,s,d,o,r[p+4],20,-405537848),o=a(o,i,s,d,r[p+9],5,568446438),d=a(d,o,i,s,r[p+14],9,-1019803690),s=a(s,d,o,i,r[p+3],14,-187363961),i=a(i,s,d,o,r[p+8],20,1163531501),o=a(o,i,s,d,r[p+13],5,-1444681467),d=a(d,o,i,s,r[p+2],9,-51403784),s=a(s,d,o,i,r[p+7],14,1735328473),i=a(i,s,d,o,r[p+12],20,-1926607734),o=f(o,i,s,d,r[p+5],4,-378558),d=f(d,o,i,s,r[p+8],11,-2022574463),s=f(s,d,o,i,r[p+11],16,1839030562),i=f(i,s,d,o,r[p+14],23,-35309556),o=f(o,i,s,d,r[p+1],4,-1530992060),d=f(d,o,i,s,r[p+4],11,1272893353),s=f(s,d,o,i,r[p+7],16,-155497632),i=f(i,s,d,o,r[p+10],23,-1094730640),o=f(o,i,s,d,r[p+13],4,681279174),d=f(d,o,i,s,r[p],11,-358537222),s=f(s,d,o,i,r[p+3],16,-722521979),i=f(i,s,d,o,r[p+6],23,76029189),o=f(o,i,s,d,r[p+9],4,-640364487),d=f(d,o,i,s,r[p+12],11,-421815835),s=f(s,d,o,i,r[p+15],16,530742520),i=f(i,s,d,o,r[p+2],23,-995338651),o=c(o,i,s,d,r[p],6,-198630844),d=c(d,o,i,s,r[p+7],10,1126891415),s=c(s,d,o,i,r[p+14],15,-1416354905),i=c(i,s,d,o,r[p+5],21,-57434055),o=c(o,i,s,d,r[p+12],6,1700485571),d=c(d,o,i,s,r[p+3],10,-1894986606),s=c(s,d,o,i,r[p+10],15,-1051523),i=c(i,s,d,o,r[p+1],21,-2054922799),o=c(o,i,s,d,r[p+8],6,1873313359),d=c(d,o,i,s,r[p+15],10,-30611744),s=c(s,d,o,i,r[p+6],15,-1560198380),i=c(i,s,d,o,r[p+13],21,1309151649),o=c(o,i,s,d,r[p+4],6,-145523070),d=c(d,o,i,s,r[p+11],10,-1120210379),s=c(s,d,o,i,r[p+2],15,718787259),i=c(i,s,d,o,r[p+9],21,-343485551),o=e(o,h),i=e(i,v),s=e(s,y),d=e(d,g)}return[o,i,s,d]}(function(r){if(0===r.length)return[];for(var n=8*r.length,e=new Uint32Array(t(n)),o=0;o<n;o+=8)e[o>>5]|=(255&r[o/8])<<o%32;return e}(r),8*r.length))}))}));
1
+ !function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(n=n||self).uuidv3=r()}(this,(function(){"use strict";var n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function r(r){return"string"==typeof r&&n.test(r)}for(var e=[],t=0;t<256;++t)e.push((t+256).toString(16).substr(1));function i(n){return 14+(n+64>>>9<<4)+1}function o(n,r){var e=(65535&n)+(65535&r);return(n>>16)+(r>>16)+(e>>16)<<16|65535&e}function a(n,r,e,t,i,a){return o((f=o(o(r,n),o(t,a)))<<(u=i)|f>>>32-u,e);var f,u}function f(n,r,e,t,i,o,f){return a(r&e|~r&t,n,r,i,o,f)}function u(n,r,e,t,i,o,f){return a(r&t|e&~t,n,r,i,o,f)}function c(n,r,e,t,i,o,f){return a(r^e^t,n,r,i,o,f)}function s(n,r,e,t,i,o,f){return a(e^(r|~t),n,r,i,o,f)}return function(n,t,i){function o(n,o,a,f){if("string"==typeof n&&(n=function(n){n=unescape(encodeURIComponent(n));for(var r=[],e=0;e<n.length;++e)r.push(n.charCodeAt(e));return r}(n)),"string"==typeof o&&(o=function(n){if(!r(n))throw TypeError("Invalid UUID");var e,t=new Uint8Array(16);return t[0]=(e=parseInt(n.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=255&e,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=255&e,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=255&e,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=255&e,t[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=255&e,t}(o)),16!==o.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var u=new Uint8Array(16+n.length);if(u.set(o),u.set(n,o.length),(u=i(u))[6]=15&u[6]|t,u[8]=63&u[8]|128,a){f=f||0;for(var c=0;c<16;++c)a[f+c]=u[c];return a}return function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(e[n[t+0]]+e[n[t+1]]+e[n[t+2]]+e[n[t+3]]+"-"+e[n[t+4]]+e[n[t+5]]+"-"+e[n[t+6]]+e[n[t+7]]+"-"+e[n[t+8]]+e[n[t+9]]+"-"+e[n[t+10]]+e[n[t+11]]+e[n[t+12]]+e[n[t+13]]+e[n[t+14]]+e[n[t+15]]).toLowerCase();if(!r(i))throw TypeError("Stringified UUID is invalid");return i}(u)}try{o.name=n}catch(n){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}("v3",48,(function(n){if("string"==typeof n){var r=unescape(encodeURIComponent(n));n=new Uint8Array(r.length);for(var e=0;e<r.length;++e)n[e]=r.charCodeAt(e)}return function(n){for(var r=[],e=32*n.length,t=0;t<e;t+=8){var i=n[t>>5]>>>t%32&255,o=parseInt("0123456789abcdef".charAt(i>>>4&15)+"0123456789abcdef".charAt(15&i),16);r.push(o)}return r}(function(n,r){n[r>>5]|=128<<r%32,n[i(r)-1]=r;for(var e=1732584193,t=-271733879,a=-1732584194,d=271733878,p=0;p<n.length;p+=16){var l=e,h=t,v=a,g=d;e=f(e,t,a,d,n[p],7,-680876936),d=f(d,e,t,a,n[p+1],12,-389564586),a=f(a,d,e,t,n[p+2],17,606105819),t=f(t,a,d,e,n[p+3],22,-1044525330),e=f(e,t,a,d,n[p+4],7,-176418897),d=f(d,e,t,a,n[p+5],12,1200080426),a=f(a,d,e,t,n[p+6],17,-1473231341),t=f(t,a,d,e,n[p+7],22,-45705983),e=f(e,t,a,d,n[p+8],7,1770035416),d=f(d,e,t,a,n[p+9],12,-1958414417),a=f(a,d,e,t,n[p+10],17,-42063),t=f(t,a,d,e,n[p+11],22,-1990404162),e=f(e,t,a,d,n[p+12],7,1804603682),d=f(d,e,t,a,n[p+13],12,-40341101),a=f(a,d,e,t,n[p+14],17,-1502002290),t=f(t,a,d,e,n[p+15],22,1236535329),e=u(e,t,a,d,n[p+1],5,-165796510),d=u(d,e,t,a,n[p+6],9,-1069501632),a=u(a,d,e,t,n[p+11],14,643717713),t=u(t,a,d,e,n[p],20,-373897302),e=u(e,t,a,d,n[p+5],5,-701558691),d=u(d,e,t,a,n[p+10],9,38016083),a=u(a,d,e,t,n[p+15],14,-660478335),t=u(t,a,d,e,n[p+4],20,-405537848),e=u(e,t,a,d,n[p+9],5,568446438),d=u(d,e,t,a,n[p+14],9,-1019803690),a=u(a,d,e,t,n[p+3],14,-187363961),t=u(t,a,d,e,n[p+8],20,1163531501),e=u(e,t,a,d,n[p+13],5,-1444681467),d=u(d,e,t,a,n[p+2],9,-51403784),a=u(a,d,e,t,n[p+7],14,1735328473),t=u(t,a,d,e,n[p+12],20,-1926607734),e=c(e,t,a,d,n[p+5],4,-378558),d=c(d,e,t,a,n[p+8],11,-2022574463),a=c(a,d,e,t,n[p+11],16,1839030562),t=c(t,a,d,e,n[p+14],23,-35309556),e=c(e,t,a,d,n[p+1],4,-1530992060),d=c(d,e,t,a,n[p+4],11,1272893353),a=c(a,d,e,t,n[p+7],16,-155497632),t=c(t,a,d,e,n[p+10],23,-1094730640),e=c(e,t,a,d,n[p+13],4,681279174),d=c(d,e,t,a,n[p],11,-358537222),a=c(a,d,e,t,n[p+3],16,-722521979),t=c(t,a,d,e,n[p+6],23,76029189),e=c(e,t,a,d,n[p+9],4,-640364487),d=c(d,e,t,a,n[p+12],11,-421815835),a=c(a,d,e,t,n[p+15],16,530742520),t=c(t,a,d,e,n[p+2],23,-995338651),e=s(e,t,a,d,n[p],6,-198630844),d=s(d,e,t,a,n[p+7],10,1126891415),a=s(a,d,e,t,n[p+14],15,-1416354905),t=s(t,a,d,e,n[p+5],21,-57434055),e=s(e,t,a,d,n[p+12],6,1700485571),d=s(d,e,t,a,n[p+3],10,-1894986606),a=s(a,d,e,t,n[p+10],15,-1051523),t=s(t,a,d,e,n[p+1],21,-2054922799),e=s(e,t,a,d,n[p+8],6,1873313359),d=s(d,e,t,a,n[p+15],10,-30611744),a=s(a,d,e,t,n[p+6],15,-1560198380),t=s(t,a,d,e,n[p+13],21,1309151649),e=s(e,t,a,d,n[p+4],6,-145523070),d=s(d,e,t,a,n[p+11],10,-1120210379),a=s(a,d,e,t,n[p+2],15,718787259),t=s(t,a,d,e,n[p+9],21,-343485551),e=o(e,l),t=o(t,h),a=o(a,v),d=o(d,g)}return[e,t,a,d]}(function(n){if(0===n.length)return[];for(var r=8*n.length,e=new Uint32Array(i(r)),t=0;t<r;t+=8)e[t>>5]|=(255&n[t/8])<<t%32;return e}(n),8*n.length))}))}));
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).uuidv4=e()}(this,(function(){"use strict";var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),e=new Uint8Array(16);function n(){if(!t)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(e)}for(var o=[],r=0;r<256;++r)o.push((r+256).toString(16).substr(1));return function(t,e,r){"string"==typeof t&&(e="binary"===t?new Uint8Array(16):null,t=null);var u=(t=t||{}).random||(t.rng||n)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,e){for(var i=r||0,d=0;d<16;++d)e[i+d]=u[d];return e}return function(t,e){var n=e||0,r=o;return(r[t[n+0]]+r[t[n+1]]+r[t[n+2]]+r[t[n+3]]+"-"+r[t[n+4]]+r[t[n+5]]+"-"+r[t[n+6]]+r[t[n+7]]+"-"+r[t[n+8]]+r[t[n+9]]+"-"+r[t[n+10]]+r[t[n+11]]+r[t[n+12]]+r[t[n+13]]+r[t[n+14]]+r[t[n+15]]).toLowerCase()}(u)}}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).uuidv4=e()}(this,(function(){"use strict";var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),e=new Uint8Array(16);function r(){if(!t)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(e)}var n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function o(t){return"string"==typeof t&&n.test(t)}for(var u=[],i=0;i<256;++i)u.push((i+256).toString(16).substr(1));return function(t,e,n){var i=(t=t||{}).random||(t.rng||r)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(var f=0;f<16;++f)e[n+f]=i[f];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(u[t[e+0]]+u[t[e+1]]+u[t[e+2]]+u[t[e+3]]+"-"+u[t[e+4]]+u[t[e+5]]+"-"+u[t[e+6]]+u[t[e+7]]+"-"+u[t[e+8]]+u[t[e+9]]+"-"+u[t[e+10]]+u[t[e+11]]+u[t[e+12]]+u[t[e+13]]+u[t[e+14]]+u[t[e+15]]).toLowerCase();if(!o(r))throw TypeError("Stringified UUID is invalid");return r}(i)}}));
@@ -1 +1 @@
1
- !function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r=r||self).uuidv5=e()}(this,(function(){"use strict";for(var r=[],e=0;e<256;++e)r.push((e+256).toString(16).substr(1));function n(r,e,n,t){switch(r){case 0:return e&n^~e&t;case 1:return e^n^t;case 2:return e&n^e&t^n&t;case 3:return e^n^t}}function t(r,e){return r<<e|r>>>32-e}return function(e,n,t){function a(e,a,o,f){var u=o&&f||0;if("string"==typeof e&&(e=function(r){r=unescape(encodeURIComponent(r));for(var e=[],n=0;n<r.length;++n)e.push(r.charCodeAt(n));return e}(e)),"string"==typeof a&&(a=function(r){var e=[];return r.replace(/[a-fA-F0-9]{2}/g,(function(r){e.push(parseInt(r,16))})),e}(a)),!Array.isArray(e))throw TypeError("value must be an array of bytes");if(!Array.isArray(a)||16!==a.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var c=t(a.concat(e));if(c[6]=15&c[6]|n,c[8]=63&c[8]|128,o)for(var i=0;i<16;++i)o[u+i]=c[i];return o||function(e,n){var t=n||0,a=r;return(a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]).toLowerCase()}(c)}try{a.name=e}catch(r){}return a.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",a.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",a}("v5",80,(function(r){var e=[1518500249,1859775393,2400959708,3395469782],a=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof r){var o=unescape(encodeURIComponent(r));r=[];for(var f=0;f<o.length;++f)r.push(o.charCodeAt(f))}r.push(128);for(var u=r.length/4+2,c=Math.ceil(u/16),i=new Array(c),s=0;s<c;++s){for(var p=new Uint32Array(16),d=0;d<16;++d)p[d]=r[64*s+4*d]<<24|r[64*s+4*d+1]<<16|r[64*s+4*d+2]<<8|r[64*s+4*d+3];i[s]=p}i[c-1][14]=8*(r.length-1)/Math.pow(2,32),i[c-1][14]=Math.floor(i[c-1][14]),i[c-1][15]=8*(r.length-1)&4294967295;for(var h=0;h<c;++h){for(var v=new Uint32Array(80),y=0;y<16;++y)v[y]=i[h][y];for(var l=16;l<80;++l)v[l]=t(v[l-3]^v[l-8]^v[l-14]^v[l-16],1);for(var b=a[0],g=a[1],A=a[2],m=a[3],w=a[4],C=0;C<80;++C){var U=Math.floor(C/20),M=t(b,5)+n(U,g,A,m)+w+e[U]+v[C]>>>0;w=m,m=A,A=t(g,30)>>>0,g=b,b=M}a[0]=a[0]+b>>>0,a[1]=a[1]+g>>>0,a[2]=a[2]+A>>>0,a[3]=a[3]+m>>>0,a[4]=a[4]+w>>>0}return[a[0]>>24&255,a[0]>>16&255,a[0]>>8&255,255&a[0],a[1]>>24&255,a[1]>>16&255,a[1]>>8&255,255&a[1],a[2]>>24&255,a[2]>>16&255,a[2]>>8&255,255&a[2],a[3]>>24&255,a[3]>>16&255,a[3]>>8&255,255&a[3],a[4]>>24&255,a[4]>>16&255,a[4]>>8&255,255&a[4]]}))}));
1
+ !function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r=r||self).uuidv5=e()}(this,(function(){"use strict";var r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function e(e){return"string"==typeof e&&r.test(e)}for(var t=[],n=0;n<256;++n)t.push((n+256).toString(16).substr(1));function a(r,e,t,n){switch(r){case 0:return e&t^~e&n;case 1:return e^t^n;case 2:return e&t^e&n^t&n;case 3:return e^t^n}}function o(r,e){return r<<e|r>>>32-e}return function(r,n,a){function o(r,o,i,f){if("string"==typeof r&&(r=function(r){r=unescape(encodeURIComponent(r));for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t));return e}(r)),"string"==typeof o&&(o=function(r){if(!e(r))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(r.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(r.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(r.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(r.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(r.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}(o)),16!==o.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var s=new Uint8Array(16+r.length);if(s.set(o),s.set(r,o.length),(s=a(s))[6]=15&s[6]|n,s[8]=63&s[8]|128,i){f=f||0;for(var u=0;u<16;++u)i[f+u]=s[u];return i}return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=(t[r[n+0]]+t[r[n+1]]+t[r[n+2]]+t[r[n+3]]+"-"+t[r[n+4]]+t[r[n+5]]+"-"+t[r[n+6]]+t[r[n+7]]+"-"+t[r[n+8]]+t[r[n+9]]+"-"+t[r[n+10]]+t[r[n+11]]+t[r[n+12]]+t[r[n+13]]+t[r[n+14]]+t[r[n+15]]).toLowerCase();if(!e(a))throw TypeError("Stringified UUID is invalid");return a}(s)}try{o.name=r}catch(r){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}("v5",80,(function(r){var e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof r){var n=unescape(encodeURIComponent(r));r=[];for(var i=0;i<n.length;++i)r.push(n.charCodeAt(i))}else Array.isArray(r)||(r=Array.prototype.slice.call(r));r.push(128);for(var f=r.length/4+2,s=Math.ceil(f/16),u=new Array(s),c=0;c<s;++c){for(var l=new Uint32Array(16),p=0;p<16;++p)l[p]=r[64*c+4*p]<<24|r[64*c+4*p+1]<<16|r[64*c+4*p+2]<<8|r[64*c+4*p+3];u[c]=l}u[s-1][14]=8*(r.length-1)/Math.pow(2,32),u[s-1][14]=Math.floor(u[s-1][14]),u[s-1][15]=8*(r.length-1)&4294967295;for(var d=0;d<s;++d){for(var h=new Uint32Array(80),v=0;v<16;++v)h[v]=u[d][v];for(var y=16;y<80;++y)h[y]=o(h[y-3]^h[y-8]^h[y-14]^h[y-16],1);for(var g=t[0],b=t[1],w=t[2],U=t[3],A=t[4],I=0;I<80;++I){var m=Math.floor(I/20),C=o(g,5)+a(m,b,w,U)+A+e[m]+h[I]>>>0;A=U,U=w,w=o(b,30)>>>0,b=g,g=C}t[0]=t[0]+g>>>0,t[1]=t[1]+b>>>0,t[2]=t[2]+w>>>0,t[3]=t[3]+U>>>0,t[4]=t[4]+A>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,255&t[0],t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,255&t[1],t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,255&t[2],t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,255&t[3],t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,255&t[4]]}))}));
package/dist/uuid-bin.js CHANGED
@@ -43,8 +43,15 @@ switch (version) {
43
43
  let namespace = args.shift();
44
44
  (0, _assert.default)(name != null, 'v3 name not specified');
45
45
  (0, _assert.default)(namespace != null, 'v3 namespace not specified');
46
- if (namespace === 'URL') namespace = _v2.default.URL;
47
- if (namespace === 'DNS') namespace = _v2.default.DNS;
46
+
47
+ if (namespace === 'URL') {
48
+ namespace = _v2.default.URL;
49
+ }
50
+
51
+ if (namespace === 'DNS') {
52
+ namespace = _v2.default.DNS;
53
+ }
54
+
48
55
  console.log((0, _v2.default)(name, namespace));
49
56
  break;
50
57
  }
@@ -59,8 +66,15 @@ switch (version) {
59
66
  let namespace = args.shift();
60
67
  (0, _assert.default)(name != null, 'v5 name not specified');
61
68
  (0, _assert.default)(namespace != null, 'v5 namespace not specified');
62
- if (namespace === 'URL') namespace = _v4.default.URL;
63
- if (namespace === 'DNS') namespace = _v4.default.DNS;
69
+
70
+ if (namespace === 'URL') {
71
+ namespace = _v4.default.URL;
72
+ }
73
+
74
+ if (namespace === 'DNS') {
75
+ namespace = _v4.default.DNS;
76
+ }
77
+
64
78
  console.log((0, _v4.default)(name, namespace));
65
79
  break;
66
80
  }
package/dist/v1.js CHANGED
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  var _rng = _interopRequireDefault(require("./rng.js"));
9
9
 
10
- var _bytesToUuid = _interopRequireDefault(require("./bytesToUuid.js"));
10
+ var _stringify = _interopRequireDefault(require("./stringify.js"));
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
@@ -25,7 +25,7 @@ let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
25
25
 
26
26
  function v1(options, buf, offset) {
27
27
  let i = buf && offset || 0;
28
- const b = buf || [];
28
+ const b = buf || new Array(16);
29
29
  options = options || {};
30
30
  let node = options.node || _nodeId;
31
31
  let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
@@ -100,7 +100,7 @@ function v1(options, buf, offset) {
100
100
  b[i + n] = node[n];
101
101
  }
102
102
 
103
- return buf || (0, _bytesToUuid.default)(b);
103
+ return buf || (0, _stringify.default)(b);
104
104
  }
105
105
 
106
106
  var _default = v1;
package/dist/v35.js CHANGED
@@ -6,18 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = _default;
7
7
  exports.URL = exports.DNS = void 0;
8
8
 
9
- var _bytesToUuid = _interopRequireDefault(require("./bytesToUuid.js"));
9
+ var _stringify = _interopRequireDefault(require("./stringify.js"));
10
10
 
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ var _parse = _interopRequireDefault(require("./parse.js"));
12
12
 
13
- function uuidToBytes(uuid) {
14
- // Note: We assume we're being passed a valid uuid string
15
- const bytes = [];
16
- uuid.replace(/[a-fA-F0-9]{2}/g, function (hex) {
17
- bytes.push(parseInt(hex, 16));
18
- });
19
- return bytes;
20
- }
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
14
 
22
15
  function stringToBytes(str) {
23
16
  str = unescape(encodeURIComponent(str)); // UTF8 escape
@@ -38,30 +31,39 @@ exports.URL = URL;
38
31
 
39
32
  function _default(name, version, hashfunc) {
40
33
  function generateUUID(value, namespace, buf, offset) {
41
- const off = buf && offset || 0;
42
- if (typeof value === 'string') value = stringToBytes(value);
43
- if (typeof namespace === 'string') namespace = uuidToBytes(namespace);
34
+ if (typeof value === 'string') {
35
+ value = stringToBytes(value);
36
+ }
44
37
 
45
- if (!Array.isArray(value)) {
46
- throw TypeError('value must be an array of bytes');
38
+ if (typeof namespace === 'string') {
39
+ namespace = (0, _parse.default)(namespace);
47
40
  }
48
41
 
49
- if (!Array.isArray(namespace) || namespace.length !== 16) {
50
- throw TypeError('namespace must be uuid string or an Array of 16 byte values');
51
- } // Per 4.3
42
+ if (namespace.length !== 16) {
43
+ throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
44
+ } // Compute hash of namespace and value, Per 4.3
45
+ // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
46
+ // hashfunc([...namespace, ... value])`
52
47
 
53
48
 
54
- const bytes = hashfunc(namespace.concat(value));
49
+ let bytes = new Uint8Array(16 + value.length);
50
+ bytes.set(namespace);
51
+ bytes.set(value, namespace.length);
52
+ bytes = hashfunc(bytes);
55
53
  bytes[6] = bytes[6] & 0x0f | version;
56
54
  bytes[8] = bytes[8] & 0x3f | 0x80;
57
55
 
58
56
  if (buf) {
59
- for (let idx = 0; idx < 16; ++idx) {
60
- buf[off + idx] = bytes[idx];
57
+ offset = offset || 0;
58
+
59
+ for (let i = 0; i < 16; ++i) {
60
+ buf[offset + i] = bytes[i];
61
61
  }
62
+
63
+ return buf;
62
64
  }
63
65
 
64
- return buf || (0, _bytesToUuid.default)(bytes);
66
+ return (0, _stringify.default)(bytes);
65
67
  } // Function#name is not settable on some platforms (#270)
66
68
 
67
69
 
package/dist/v4.js CHANGED
@@ -7,16 +7,11 @@ exports.default = void 0;
7
7
 
8
8
  var _rng = _interopRequireDefault(require("./rng.js"));
9
9
 
10
- var _bytesToUuid = _interopRequireDefault(require("./bytesToUuid.js"));
10
+ var _stringify = _interopRequireDefault(require("./stringify.js"));
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
14
  function v4(options, buf, offset) {
15
- if (typeof options === 'string') {
16
- buf = options === 'binary' ? new Uint8Array(16) : null;
17
- options = null;
18
- }
19
-
20
15
  options = options || {};
21
16
 
22
17
  const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
@@ -26,16 +21,16 @@ function v4(options, buf, offset) {
26
21
  rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
27
22
 
28
23
  if (buf) {
29
- const start = offset || 0;
24
+ offset = offset || 0;
30
25
 
31
26
  for (let i = 0; i < 16; ++i) {
32
- buf[start + i] = rnds[i];
27
+ buf[offset + i] = rnds[i];
33
28
  }
34
29
 
35
30
  return buf;
36
31
  }
37
32
 
38
- return (0, _bytesToUuid.default)(rnds);
33
+ return (0, _stringify.default)(rnds);
39
34
  }
40
35
 
41
36
  var _default = v4;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _regex = _interopRequireDefault(require("./regex.js"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ function validate(uuid) {
13
+ return typeof uuid === 'string' && _regex.default.test(uuid);
14
+ }
15
+
16
+ var _default = validate;
17
+ exports.default = _default;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _validate = _interopRequireDefault(require("./validate.js"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ function version(uuid) {
13
+ if (!(0, _validate.default)(uuid)) {
14
+ throw TypeError('Invalid UUID');
15
+ }
16
+
17
+ return parseInt(uuid.substr(14, 1), 16);
18
+ }
19
+
20
+ var _default = version;
21
+ exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uuid",
3
- "version": "8.1.0",
3
+ "version": "8.3.0",
4
4
  "description": "RFC4122 (v1, v4, and v5) UUIDs",
5
5
  "commitlint": {
6
6
  "extends": [
@@ -19,11 +19,15 @@
19
19
  "sideEffects": false,
20
20
  "main": "./dist/index.js",
21
21
  "exports": {
22
- "./package.json": "./package.json",
23
22
  ".": {
24
- "require": "./dist/index.js",
25
- "import": "./wrapper.mjs"
26
- }
23
+ "node": {
24
+ "module": "./dist/esm-node/index.js",
25
+ "require": "./dist/index.js",
26
+ "import": "./wrapper.mjs"
27
+ },
28
+ "default": "./dist/esm-browser/index.js"
29
+ },
30
+ "./package.json": "./package.json"
27
31
  },
28
32
  "module": "./dist/esm-node/index.js",
29
33
  "browser": {
@@ -41,38 +45,39 @@
41
45
  "wrapper.mjs"
42
46
  ],
43
47
  "devDependencies": {
44
- "@babel/cli": "7.8.4",
45
- "@babel/core": "7.9.0",
46
- "@babel/preset-env": "7.9.5",
47
- "@commitlint/cli": "8.3.5",
48
- "@commitlint/config-conventional": "8.3.4",
49
- "@rollup/plugin-node-resolve": "7.1.3",
50
- "@wdio/browserstack-service": "6.0.12",
51
- "@wdio/cli": "6.0.15",
52
- "@wdio/jasmine-framework": "6.0.15",
53
- "@wdio/local-runner": "6.0.15",
54
- "@wdio/spec-reporter": "6.0.14",
55
- "@wdio/static-server-service": "6.0.13",
56
- "@wdio/sync": "6.0.15",
48
+ "@babel/cli": "7.10.3",
49
+ "@babel/core": "7.10.3",
50
+ "@babel/preset-env": "7.10.3",
51
+ "@commitlint/cli": "9.1.2",
52
+ "@commitlint/config-conventional": "9.0.1",
53
+ "@rollup/plugin-node-resolve": "8.0.1",
54
+ "@wdio/browserstack-service": "6.1.15",
55
+ "@wdio/cli": "6.1.20",
56
+ "@wdio/jasmine-framework": "6.1.17",
57
+ "@wdio/local-runner": "6.1.20",
58
+ "@wdio/spec-reporter": "6.1.14",
59
+ "@wdio/static-server-service": "6.1.14",
60
+ "@wdio/sync": "6.1.14",
57
61
  "babel-eslint": "10.1.0",
58
- "bundlewatch": "0.2.6",
59
- "eslint": "6.8.0",
60
- "eslint-config-prettier": "6.10.1",
62
+ "bundlewatch": "0.2.7",
63
+ "eslint": "7.3.0",
64
+ "eslint-config-prettier": "6.11.0",
61
65
  "eslint-config-standard": "14.1.1",
62
- "eslint-plugin-import": "2.20.2",
66
+ "eslint-plugin-import": "2.21.2",
63
67
  "eslint-plugin-node": "11.1.0",
64
- "eslint-plugin-prettier": "3.1.3",
68
+ "eslint-plugin-prettier": "3.1.4",
65
69
  "eslint-plugin-promise": "4.2.1",
66
70
  "eslint-plugin-standard": "4.0.1",
67
71
  "husky": "4.2.5",
68
- "jest": "25.3.0",
69
- "lint-staged": "10.1.3",
72
+ "jest": "25.5.4",
73
+ "lint-staged": "10.2.11",
70
74
  "npm-run-all": "4.1.5",
71
- "prettier": "2.0.4",
72
- "rollup": "2.6.1",
73
- "rollup-plugin-terser": "5.3.0",
75
+ "prettier": "2.0.5",
76
+ "random-seed": "0.3.0",
77
+ "rollup": "2.18.0",
78
+ "rollup-plugin-terser": "6.1.0",
74
79
  "runmd": "1.3.2",
75
- "standard-version": "7.1.0"
80
+ "standard-version": "8.0.2"
76
81
  },
77
82
  "scripts": {
78
83
  "examples:browser:webpack:build": "cd examples/browser-webpack && npm install && npm run build",
package/wrapper.mjs CHANGED
@@ -3,3 +3,8 @@ export const v1 = uuid.v1;
3
3
  export const v3 = uuid.v3;
4
4
  export const v4 = uuid.v4;
5
5
  export const v5 = uuid.v5;
6
+ export const NIL = uuid.NIL;
7
+ export const version = uuid.version;
8
+ export const validate = uuid.validate;
9
+ export const stringify = uuid.stringify;
10
+ export const parse = uuid.parse;
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- /**
9
- * Convert array of 16 byte values to UUID string format of the form:
10
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
11
- */
12
- const byteToHex = [];
13
-
14
- for (let i = 0; i < 256; ++i) {
15
- byteToHex.push((i + 0x100).toString(16).substr(1));
16
- }
17
-
18
- function bytesToUuid(buf, offset) {
19
- const i = offset || 0;
20
- const bth = byteToHex; // Note: Be careful editing this code! It's been tuned for performance
21
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
22
-
23
- return (bth[buf[i + 0]] + bth[buf[i + 1]] + bth[buf[i + 2]] + bth[buf[i + 3]] + '-' + bth[buf[i + 4]] + bth[buf[i + 5]] + '-' + bth[buf[i + 6]] + bth[buf[i + 7]] + '-' + bth[buf[i + 8]] + bth[buf[i + 9]] + '-' + bth[buf[i + 10]] + bth[buf[i + 11]] + bth[buf[i + 12]] + bth[buf[i + 13]] + bth[buf[i + 14]] + bth[buf[i + 15]]).toLowerCase();
24
- }
25
-
26
- var _default = bytesToUuid;
27
- exports.default = _default;
@@ -1,19 +0,0 @@
1
- /**
2
- * Convert array of 16 byte values to UUID string format of the form:
3
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
4
- */
5
- var byteToHex = [];
6
-
7
- for (var i = 0; i < 256; ++i) {
8
- byteToHex.push((i + 0x100).toString(16).substr(1));
9
- }
10
-
11
- function bytesToUuid(buf, offset) {
12
- var i = offset || 0;
13
- var bth = byteToHex; // Note: Be careful editing this code! It's been tuned for performance
14
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
15
-
16
- return (bth[buf[i + 0]] + bth[buf[i + 1]] + bth[buf[i + 2]] + bth[buf[i + 3]] + '-' + bth[buf[i + 4]] + bth[buf[i + 5]] + '-' + bth[buf[i + 6]] + bth[buf[i + 7]] + '-' + bth[buf[i + 8]] + bth[buf[i + 9]] + '-' + bth[buf[i + 10]] + bth[buf[i + 11]] + bth[buf[i + 12]] + bth[buf[i + 13]] + bth[buf[i + 14]] + bth[buf[i + 15]]).toLowerCase();
17
- }
18
-
19
- export default bytesToUuid;
@@ -1,19 +0,0 @@
1
- /**
2
- * Convert array of 16 byte values to UUID string format of the form:
3
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
4
- */
5
- const byteToHex = [];
6
-
7
- for (let i = 0; i < 256; ++i) {
8
- byteToHex.push((i + 0x100).toString(16).substr(1));
9
- }
10
-
11
- function bytesToUuid(buf, offset) {
12
- const i = offset || 0;
13
- const bth = byteToHex; // Note: Be careful editing this code! It's been tuned for performance
14
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
15
-
16
- return (bth[buf[i + 0]] + bth[buf[i + 1]] + bth[buf[i + 2]] + bth[buf[i + 3]] + '-' + bth[buf[i + 4]] + bth[buf[i + 5]] + '-' + bth[buf[i + 6]] + bth[buf[i + 7]] + '-' + bth[buf[i + 8]] + bth[buf[i + 9]] + '-' + bth[buf[i + 10]] + bth[buf[i + 11]] + bth[buf[i + 12]] + bth[buf[i + 13]] + bth[buf[i + 14]] + bth[buf[i + 15]]).toLowerCase();
17
- }
18
-
19
- export default bytesToUuid;