Socket
Socket
Sign inDemoInstall

uuid

Package Overview
Dependencies
0
Maintainers
4
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.2.0 to 8.3.0-beta.0

dist/esm-browser/nil.js

7

dist/esm-browser/index.js
export { default as v1 } from './v1.js';
export { default as v3 } from './v3.js';
export { default as v4 } from './v4.js';
export { default as v5 } from './v5.js';
export { default as v5 } from './v5.js';
export { default as NIL } from './nil.js';
export { default as version } from './version.js';
export { default as validate } from './validate.js';
export { default as stringify } from './stringify.js';
export { default as parse } from './parse.js';

@@ -35,2 +35,5 @@ // Adapted from Chris Veness' SHA1 code at

}
} else if (!Array.isArray(bytes)) {
// Convert Array-like to Array
bytes = Array.prototype.slice.call(bytes);
}

@@ -37,0 +40,0 @@

4

dist/esm-browser/v1.js
import rng from './rng.js';
import bytesToUuid from './bytesToUuid.js'; // **`v1()` - Generate time-based UUID**
import stringify from './stringify.js'; // **`v1()` - Generate time-based UUID**
//

@@ -92,5 +92,5 @@ // Inspired by https://github.com/LiosK/UUID.js

return buf || bytesToUuid(b);
return buf || stringify(b);
}
export default v1;

@@ -1,12 +0,4 @@

import bytesToUuid from './bytesToUuid.js';
import stringify from './stringify.js';
import parse from './parse.js';
function uuidToBytes(uuid) {
// Note: We assume we're being passed a valid uuid string
var bytes = [];
uuid.replace(/[a-fA-F0-9]{2}/g, function (hex) {
bytes.push(parseInt(hex, 16));
});
return bytes;
}
function stringToBytes(str) {

@@ -33,15 +25,16 @@ str = unescape(encodeURIComponent(str)); // UTF8 escape

if (typeof namespace === 'string') {
namespace = uuidToBytes(namespace);
namespace = parse(namespace);
}
if (!Array.isArray(value)) {
throw TypeError('value must be an array of bytes');
}
if (namespace.length !== 16) {
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
} // Compute hash of namespace and value, Per 4.3
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
// hashfunc([...namespace, ... value])`
if (!Array.isArray(namespace) || namespace.length !== 16) {
throw TypeError('namespace must be uuid string or an Array of 16 byte values');
} // Per 4.3
var bytes = hashfunc(namespace.concat(value));
var bytes = new Uint8Array(16 + value.length);
bytes.set(namespace);
bytes.set(value, namespace.length);
bytes = hashfunc(bytes);
bytes[6] = bytes[6] & 0x0f | version;

@@ -60,3 +53,3 @@ bytes[8] = bytes[8] & 0x3f | 0x80;

return bytesToUuid(bytes);
return stringify(bytes);
} // Function#name is not settable on some platforms (#270)

@@ -63,0 +56,0 @@

import rng from './rng.js';
import bytesToUuid from './bytesToUuid.js';
import stringify from './stringify.js';

@@ -21,5 +21,5 @@ function v4(options, buf, offset) {

return bytesToUuid(rnds);
return stringify(rnds);
}
export default v4;
export { default as v1 } from './v1.js';
export { default as v3 } from './v3.js';
export { default as v4 } from './v4.js';
export { default as v5 } from './v5.js';
export { default as v5 } from './v5.js';
export { default as NIL } from './nil.js';
export { default as version } from './version.js';
export { default as validate } from './validate.js';
export { default as stringify } from './stringify.js';
export { default as parse } from './parse.js';
import rng from './rng.js';
import bytesToUuid from './bytesToUuid.js'; // **`v1()` - Generate time-based UUID**
import stringify from './stringify.js'; // **`v1()` - Generate time-based UUID**
//

@@ -92,5 +92,5 @@ // Inspired by https://github.com/LiosK/UUID.js

return buf || bytesToUuid(b);
return buf || stringify(b);
}
export default v1;

@@ -1,12 +0,4 @@

import bytesToUuid from './bytesToUuid.js';
import stringify from './stringify.js';
import parse from './parse.js';
function uuidToBytes(uuid) {
// Note: We assume we're being passed a valid uuid string
const bytes = [];
uuid.replace(/[a-fA-F0-9]{2}/g, function (hex) {
bytes.push(parseInt(hex, 16));
});
return bytes;
}
function stringToBytes(str) {

@@ -33,15 +25,16 @@ str = unescape(encodeURIComponent(str)); // UTF8 escape

if (typeof namespace === 'string') {
namespace = uuidToBytes(namespace);
namespace = parse(namespace);
}
if (!Array.isArray(value)) {
throw TypeError('value must be an array of bytes');
}
if (namespace.length !== 16) {
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
} // Compute hash of namespace and value, Per 4.3
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
// hashfunc([...namespace, ... value])`
if (!Array.isArray(namespace) || namespace.length !== 16) {
throw TypeError('namespace must be uuid string or an Array of 16 byte values');
} // Per 4.3
const bytes = hashfunc(namespace.concat(value));
let bytes = new Uint8Array(16 + value.length);
bytes.set(namespace);
bytes.set(value, namespace.length);
bytes = hashfunc(bytes);
bytes[6] = bytes[6] & 0x0f | version;

@@ -60,3 +53,3 @@ bytes[8] = bytes[8] & 0x3f | 0x80;

return bytesToUuid(bytes);
return stringify(bytes);
} // Function#name is not settable on some platforms (#270)

@@ -63,0 +56,0 @@

import rng from './rng.js';
import bytesToUuid from './bytesToUuid.js';
import stringify from './stringify.js';

@@ -21,5 +21,5 @@ function v4(options, buf, offset) {

return bytesToUuid(rnds);
return stringify(rnds);
}
export default v4;

@@ -30,2 +30,32 @@ "use strict";

});
Object.defineProperty(exports, "NIL", {
enumerable: true,
get: function () {
return _nil.default;
}
});
Object.defineProperty(exports, "version", {
enumerable: true,
get: function () {
return _version.default;
}
});
Object.defineProperty(exports, "validate", {
enumerable: true,
get: function () {
return _validate.default;
}
});
Object.defineProperty(exports, "stringify", {
enumerable: true,
get: function () {
return _stringify.default;
}
});
Object.defineProperty(exports, "parse", {
enumerable: true,
get: function () {
return _parse.default;
}
});

@@ -40,2 +70,12 @@ var _v = _interopRequireDefault(require("./v1.js"));

var _nil = _interopRequireDefault(require("./nil.js"));
var _version = _interopRequireDefault(require("./version.js"));
var _validate = _interopRequireDefault(require("./validate.js"));
var _stringify = _interopRequireDefault(require("./stringify.js"));
var _parse = _interopRequireDefault(require("./parse.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -42,2 +42,5 @@ "use strict";

}
} else if (!Array.isArray(bytes)) {
// Convert Array-like to Array
bytes = Array.prototype.slice.call(bytes);
}

@@ -44,0 +47,0 @@

@@ -1,1 +0,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;return(u[r[e+0]]+u[r[e+1]]+u[r[e+2]]+u[r[e+3]]+"-"+u[r[e+4]]+u[r[e+5]]+"-"+u[r[e+6]]+u[r[e+7]]+"-"+u[r[e+8]]+u[r[e+9]]+"-"+u[r[e+10]]+u[r[e+11]]+u[r[e+12]]+u[r[e+13]]+u[r[e+14]]+u[r[e+15]]).toLowerCase()}var i=0,s=0;function d(r,n,e){function t(r,t,o,a){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 u=e(t.concat(r));if(u[6]=15&u[6]|n,u[8]=63&u[8]|128,o){a=a||0;for(var f=0;f<16;++f)o[a+f]=u[f];return o}return c(u)}try{t.name=r}catch(r){}return t.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",t.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",t}function v(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 h(r,n,e,t,o,a,u){return l(n&e|~n&t,r,n,o,a,u)}function y(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=d("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[v(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=h(e,t,o,a,r[u],7,-680876936),a=h(a,e,t,o,r[u+1],12,-389564586),o=h(o,a,e,t,r[u+2],17,606105819),t=h(t,o,a,e,r[u+3],22,-1044525330),e=h(e,t,o,a,r[u+4],7,-176418897),a=h(a,e,t,o,r[u+5],12,1200080426),o=h(o,a,e,t,r[u+6],17,-1473231341),t=h(t,o,a,e,r[u+7],22,-45705983),e=h(e,t,o,a,r[u+8],7,1770035416),a=h(a,e,t,o,r[u+9],12,-1958414417),o=h(o,a,e,t,r[u+10],17,-42063),t=h(t,o,a,e,r[u+11],22,-1990404162),e=h(e,t,o,a,r[u+12],7,1804603682),a=h(a,e,t,o,r[u+13],12,-40341101),o=h(o,a,e,t,r[u+14],17,-1502002290),t=h(t,o,a,e,r[u+15],22,1236535329),e=y(e,t,o,a,r[u+1],5,-165796510),a=y(a,e,t,o,r[u+6],9,-1069501632),o=y(o,a,e,t,r[u+11],14,643717713),t=y(t,o,a,e,r[u],20,-373897302),e=y(e,t,o,a,r[u+5],5,-701558691),a=y(a,e,t,o,r[u+10],9,38016083),o=y(o,a,e,t,r[u+15],14,-660478335),t=y(t,o,a,e,r[u+4],20,-405537848),e=y(e,t,o,a,r[u+9],5,568446438),a=y(a,e,t,o,r[u+14],9,-1019803690),o=y(o,a,e,t,r[u+3],14,-187363961),t=y(t,o,a,e,r[u+8],20,1163531501),e=y(e,t,o,a,r[u+13],5,-1444681467),a=y(a,e,t,o,r[u+2],9,-51403784),o=y(o,a,e,t,r[u+7],14,1735328473),t=y(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(v(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=d("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 d=0;d<u;++d){for(var v=new Uint32Array(80),p=0;p<16;++p)v[p]=f[d][p];for(var l=16;l<80;++l)v[l]=w(v[l-3]^v[l-8]^v[l-14]^v[l-16],1);for(var h=e[0],y=e[1],g=e[2],m=e[3],b=e[4],C=0;C<80;++C){var R=Math.floor(C/20),U=w(h,5)+A(R,y,g,m)+b+n[R]+v[C]>>>0;b=m,m=g,g=w(y,30)>>>0,y=h,h=U}e[0]=e[0]+h>>>0,e[1]=e[1]+y>>>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||new Array(16),d=(r=r||{}).node||o,v=void 0!==r.clockseq?r.clockseq:a;if(null==d||null==v){var p=r.random||(r.rng||t)();null==d&&(d=o=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==v&&(v=a=16383&(p[6]<<8|p[7]))}var l=void 0!==r.msecs?r.msecs:Date.now(),h=void 0!==r.nsecs?r.nsecs:s+1,y=l-i+(h-s)/1e4;if(y<0&&void 0===r.clockseq&&(v=v+1&16383),(y<0||l>i)&&void 0===r.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");i=l,s=h,a=v;var g=(1e4*(268435455&(l+=122192928e5))+h)%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++]=v>>>8|128,f[u++]=255&v;for(var b=0;b<6;++b)f[u+b]=d[b];return n||c(f)},r.v3=b,r.v4=function(r,n,e){var o=(r=r||{}).random||(r.rng||t)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,n){e=e||0;for(var a=0;a<16;++a)n[e+a]=o[a];return n}return c(o)},r.v5=C,Object.defineProperty(r,"__esModule",{value:!0})}));
!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})}));

@@ -1,1 +0,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 n(){if(!e)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(o)}for(var t,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||new Array(16),f=(e=e||{}).node||t,p=void 0!==e.clockseq?e.clockseq:r;if(null==f||null==p){var l=e.random||(e.rng||n)();null==f&&(f=t=[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 w=m/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++]=p>>>8|128,c[a++]=255&p;for(var h=0;h<6;++h)c[a+h]=f[h];return o||function(e,o){var n=o||0;return(u[e[n+0]]+u[e[n+1]]+u[e[n+2]]+u[e[n+3]]+"-"+u[e[n+4]]+u[e[n+5]]+"-"+u[e[n+6]]+u[e[n+7]]+"-"+u[e[n+8]]+u[e[n+9]]+"-"+u[e[n+10]]+u[e[n+11]]+u[e[n+12]]+u[e[n+13]]+u[e[n+14]]+u[e[n+15]]).toLowerCase()}(c)}}));
!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 +0,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 u(r,n,t,u,o,a){return e((f=e(e(n,r),e(u,a)))<<(c=o)|f>>>32-c,t);var f,c}function o(r,n,t,e,o,a,f){return u(n&t|~n&e,r,n,o,a,f)}function a(r,n,t,e,o,a,f){return u(n&e|t&~e,r,n,o,a,f)}function f(r,n,t,e,o,a,f){return u(n^t^e,r,n,o,a,f)}function c(r,n,t,e,o,a,f){return u(t^(n|~e),r,n,o,a,f)}return function(n,t,e){function u(n,u,o,a){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 u&&(u=function(r){var n=[];return r.replace(/[a-fA-F0-9]{2}/g,(function(r){n.push(parseInt(r,16))})),n}(u)),!Array.isArray(n))throw TypeError("value must be an array of bytes");if(!Array.isArray(u)||16!==u.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var f=e(u.concat(n));if(f[6]=15&f[6]|t,f[8]=63&f[8]|128,o){a=a||0;for(var c=0;c<16;++c)o[a+c]=f[c];return o}return function(n,t){var e=t||0;return(r[n[e+0]]+r[n[e+1]]+r[n[e+2]]+r[n[e+3]]+"-"+r[n[e+4]]+r[n[e+5]]+"-"+r[n[e+6]]+r[n[e+7]]+"-"+r[n[e+8]]+r[n[e+9]]+"-"+r[n[e+10]]+r[n[e+11]]+r[n[e+12]]+r[n[e+13]]+r[n[e+14]]+r[n[e+15]]).toLowerCase()}(f)}try{u.name=n}catch(r){}return u.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",u.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",u}("v3",48,(function(r){if("string"==typeof r){var n=unescape(encodeURIComponent(r));r=new Uint8Array(n.length);for(var u=0;u<n.length;++u)r[u]=n.charCodeAt(u)}return function(r){for(var n=[],t=32*r.length,e=0;e<t;e+=8){var u=r[e>>5]>>>e%32&255,o=parseInt("0123456789abcdef".charAt(u>>>4&15)+"0123456789abcdef".charAt(15&u),16);n.push(o)}return n}(function(r,n){r[n>>5]|=128<<n%32,r[t(n)-1]=n;for(var u=1732584193,i=-271733879,s=-1732584194,d=271733878,p=0;p<r.length;p+=16){var h=u,v=i,y=s,g=d;u=o(u,i,s,d,r[p],7,-680876936),d=o(d,u,i,s,r[p+1],12,-389564586),s=o(s,d,u,i,r[p+2],17,606105819),i=o(i,s,d,u,r[p+3],22,-1044525330),u=o(u,i,s,d,r[p+4],7,-176418897),d=o(d,u,i,s,r[p+5],12,1200080426),s=o(s,d,u,i,r[p+6],17,-1473231341),i=o(i,s,d,u,r[p+7],22,-45705983),u=o(u,i,s,d,r[p+8],7,1770035416),d=o(d,u,i,s,r[p+9],12,-1958414417),s=o(s,d,u,i,r[p+10],17,-42063),i=o(i,s,d,u,r[p+11],22,-1990404162),u=o(u,i,s,d,r[p+12],7,1804603682),d=o(d,u,i,s,r[p+13],12,-40341101),s=o(s,d,u,i,r[p+14],17,-1502002290),i=o(i,s,d,u,r[p+15],22,1236535329),u=a(u,i,s,d,r[p+1],5,-165796510),d=a(d,u,i,s,r[p+6],9,-1069501632),s=a(s,d,u,i,r[p+11],14,643717713),i=a(i,s,d,u,r[p],20,-373897302),u=a(u,i,s,d,r[p+5],5,-701558691),d=a(d,u,i,s,r[p+10],9,38016083),s=a(s,d,u,i,r[p+15],14,-660478335),i=a(i,s,d,u,r[p+4],20,-405537848),u=a(u,i,s,d,r[p+9],5,568446438),d=a(d,u,i,s,r[p+14],9,-1019803690),s=a(s,d,u,i,r[p+3],14,-187363961),i=a(i,s,d,u,r[p+8],20,1163531501),u=a(u,i,s,d,r[p+13],5,-1444681467),d=a(d,u,i,s,r[p+2],9,-51403784),s=a(s,d,u,i,r[p+7],14,1735328473),i=a(i,s,d,u,r[p+12],20,-1926607734),u=f(u,i,s,d,r[p+5],4,-378558),d=f(d,u,i,s,r[p+8],11,-2022574463),s=f(s,d,u,i,r[p+11],16,1839030562),i=f(i,s,d,u,r[p+14],23,-35309556),u=f(u,i,s,d,r[p+1],4,-1530992060),d=f(d,u,i,s,r[p+4],11,1272893353),s=f(s,d,u,i,r[p+7],16,-155497632),i=f(i,s,d,u,r[p+10],23,-1094730640),u=f(u,i,s,d,r[p+13],4,681279174),d=f(d,u,i,s,r[p],11,-358537222),s=f(s,d,u,i,r[p+3],16,-722521979),i=f(i,s,d,u,r[p+6],23,76029189),u=f(u,i,s,d,r[p+9],4,-640364487),d=f(d,u,i,s,r[p+12],11,-421815835),s=f(s,d,u,i,r[p+15],16,530742520),i=f(i,s,d,u,r[p+2],23,-995338651),u=c(u,i,s,d,r[p],6,-198630844),d=c(d,u,i,s,r[p+7],10,1126891415),s=c(s,d,u,i,r[p+14],15,-1416354905),i=c(i,s,d,u,r[p+5],21,-57434055),u=c(u,i,s,d,r[p+12],6,1700485571),d=c(d,u,i,s,r[p+3],10,-1894986606),s=c(s,d,u,i,r[p+10],15,-1051523),i=c(i,s,d,u,r[p+1],21,-2054922799),u=c(u,i,s,d,r[p+8],6,1873313359),d=c(d,u,i,s,r[p+15],10,-30611744),s=c(s,d,u,i,r[p+6],15,-1560198380),i=c(i,s,d,u,r[p+13],21,1309151649),u=c(u,i,s,d,r[p+4],6,-145523070),d=c(d,u,i,s,r[p+11],10,-1120210379),s=c(s,d,u,i,r[p+2],15,718787259),i=c(i,s,d,u,r[p+9],21,-343485551),u=e(u,h),i=e(i,v),s=e(s,y),d=e(d,g)}return[u,i,s,d]}(function(r){if(0===r.length)return[];for(var n=8*r.length,e=new Uint32Array(t(n)),u=0;u<n;u+=8)e[u>>5]|=(255&r[u/8])<<u%32;return e}(r),8*r.length))}))}));
!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 +0,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 o(){if(!t)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(e)}for(var n=[],r=0;r<256;++r)n.push((r+256).toString(16).substr(1));return function(t,e,r){var u=(t=t||{}).random||(t.rng||o)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,e){r=r||0;for(var d=0;d<16;++d)e[r+d]=u[d];return e}return function(t,e){var o=e||0;return(n[t[o+0]]+n[t[o+1]]+n[t[o+2]]+n[t[o+3]]+"-"+n[t[o+4]]+n[t[o+5]]+"-"+n[t[o+6]]+n[t[o+7]]+"-"+n[t[o+8]]+n[t[o+9]]+"-"+n[t[o+10]]+n[t[o+11]]+n[t[o+12]]+n[t[o+13]]+n[t[o+14]]+n[t[o+15]]).toLowerCase()}(u)}}));
!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 +0,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 o(e,o,a,u){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 o&&(o=function(r){var e=[];return r.replace(/[a-fA-F0-9]{2}/g,(function(r){e.push(parseInt(r,16))})),e}(o)),!Array.isArray(e))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 f=t(o.concat(e));if(f[6]=15&f[6]|n,f[8]=63&f[8]|128,a){u=u||0;for(var c=0;c<16;++c)a[u+c]=f[c];return a}return function(e,n){var t=n||0;return(r[e[t+0]]+r[e[t+1]]+r[e[t+2]]+r[e[t+3]]+"-"+r[e[t+4]]+r[e[t+5]]+"-"+r[e[t+6]]+r[e[t+7]]+"-"+r[e[t+8]]+r[e[t+9]]+"-"+r[e[t+10]]+r[e[t+11]]+r[e[t+12]]+r[e[t+13]]+r[e[t+14]]+r[e[t+15]]).toLowerCase()}(f)}try{o.name=e}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],o=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof r){var a=unescape(encodeURIComponent(r));r=[];for(var u=0;u<a.length;++u)r.push(a.charCodeAt(u))}r.push(128);for(var f=r.length/4+2,c=Math.ceil(f/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=o[0],g=o[1],A=o[2],m=o[3],w=o[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}o[0]=o[0]+b>>>0,o[1]=o[1]+g>>>0,o[2]=o[2]+A>>>0,o[3]=o[3]+m>>>0,o[4]=o[4]+w>>>0}return[o[0]>>24&255,o[0]>>16&255,o[0]>>8&255,255&o[0],o[1]>>24&255,o[1]>>16&255,o[1]>>8&255,255&o[1],o[2]>>24&255,o[2]>>16&255,o[2]>>8&255,255&o[2],o[3]>>24&255,o[3]>>16&255,o[3]>>8&255,255&o[3],o[4]>>24&255,o[4]>>16&255,o[4]>>8&255,255&o[4]]}))}));
!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]]}))}));

@@ -10,3 +10,3 @@ "use strict";

var _bytesToUuid = _interopRequireDefault(require("./bytesToUuid.js"));
var _stringify = _interopRequireDefault(require("./stringify.js"));

@@ -104,3 +104,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

return buf || (0, _bytesToUuid.default)(b);
return buf || (0, _stringify.default)(b);
}

@@ -107,0 +107,0 @@

@@ -9,15 +9,8 @@ "use strict";

var _bytesToUuid = _interopRequireDefault(require("./bytesToUuid.js"));
var _stringify = _interopRequireDefault(require("./stringify.js"));
var _parse = _interopRequireDefault(require("./parse.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function uuidToBytes(uuid) {
// Note: We assume we're being passed a valid uuid string
const bytes = [];
uuid.replace(/[a-fA-F0-9]{2}/g, function (hex) {
bytes.push(parseInt(hex, 16));
});
return bytes;
}
function stringToBytes(str) {

@@ -47,15 +40,16 @@ str = unescape(encodeURIComponent(str)); // UTF8 escape

if (typeof namespace === 'string') {
namespace = uuidToBytes(namespace);
namespace = (0, _parse.default)(namespace);
}
if (!Array.isArray(value)) {
throw TypeError('value must be an array of bytes');
}
if (namespace.length !== 16) {
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
} // Compute hash of namespace and value, Per 4.3
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
// hashfunc([...namespace, ... value])`
if (!Array.isArray(namespace) || namespace.length !== 16) {
throw TypeError('namespace must be uuid string or an Array of 16 byte values');
} // Per 4.3
const bytes = hashfunc(namespace.concat(value));
let bytes = new Uint8Array(16 + value.length);
bytes.set(namespace);
bytes.set(value, namespace.length);
bytes = hashfunc(bytes);
bytes[6] = bytes[6] & 0x0f | version;

@@ -74,3 +68,3 @@ bytes[8] = bytes[8] & 0x3f | 0x80;

return (0, _bytesToUuid.default)(bytes);
return (0, _stringify.default)(bytes);
} // Function#name is not settable on some platforms (#270)

@@ -77,0 +71,0 @@

@@ -10,3 +10,3 @@ "use strict";

var _bytesToUuid = _interopRequireDefault(require("./bytesToUuid.js"));
var _stringify = _interopRequireDefault(require("./stringify.js"));

@@ -34,3 +34,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

return (0, _bytesToUuid.default)(rnds);
return (0, _stringify.default)(rnds);
}

@@ -37,0 +37,0 @@

{
"name": "uuid",
"version": "8.2.0",
"version": "8.3.0-beta.0",
"description": "RFC4122 (v1, v4, and v5) UUIDs",

@@ -51,3 +51,3 @@ "commitlint": {

"@babel/preset-env": "7.10.3",
"@commitlint/cli": "9.0.1",
"@commitlint/cli": "9.1.2",
"@commitlint/config-conventional": "9.0.1",

@@ -77,6 +77,7 @@ "@rollup/plugin-node-resolve": "8.0.1",

"prettier": "2.0.5",
"random-seed": "0.3.0",
"rollup": "2.18.0",
"rollup-plugin-terser": "6.1.0",
"runmd": "1.3.2",
"standard-version": "8.0.0"
"standard-version": "8.0.2"
},

@@ -83,0 +84,0 @@ "scripts": {

@@ -5,3 +5,3 @@ <!--

# uuid [![Build Status](https://github.com/uuidjs/uuid/workflows/CI/badge.svg)](https://github.com/uuidjs/uuid/actions)
# uuid [![CI](https://github.com/uuidjs/uuid/workflows/CI/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [![Browser](https://github.com/uuidjs/uuid/workflows/Browser/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ABrowser)

@@ -21,6 +21,10 @@ For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs

**Upgrading from uuid\@3?** Your code is probably okay, but check out [Upgrading From uuid\@3](#upgrading-from-uuid3) for details.
**Upgrading from `uuid@3.x`?** Your code is probably okay, but check out [Upgrading From `uuid@3.x`](#upgrading-from-uuid3x) for details.
## Quickstart
To create a random UUID...
**1. Install**
```shell

@@ -30,15 +34,4 @@ npm install uuid

Once installed, decide which type of UUID you need. RFC4122 provides for four versions, all of which are supported here. In order of popularity, they are:
**2. Create a UUID** (ES6 module syntax)
- Version 4 (random) - Created from cryptographically-strong random values
- Version 1 (timestamp) - Created from the system clock (plus random values)
- Version 5 (namespace, SHA-1) - Created from user-supplied name and namespace strings
- Version 3 (namespace, MD5) - Like version 5, above, but with a poorer hash algorithm
**Unsure which one to use?** Use version 4 (random) unless you have a specific need for one of the other versions. See also [this FAQ](https://github.com/tc39/proposal-uuid#faq).
### Create Version 4 (Random) UUIDs
ECMAScript Module syntax:
```javascript

@@ -49,3 +42,3 @@ import { v4 as uuidv4 } from 'uuid';

CommonJS syntax:
... or using CommonJS syntax:

@@ -57,60 +50,155 @@ ```javascript

### Create Version 1 (Timestamp) UUIDs
For timestamp UUIDs, namespace UUIDs, and other options read on ...
## API Summary
| | | |
| --- | --- | --- |
| [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) | New in `uuid@8.2` |
| [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes | New in `uuid@8.2` |
| [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string | New in `uuid@8.2` |
| [`uuid.v1()`](#uuidv1options-buffer-offset) | Create a version 1 (timestamp) UUID | |
| [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) | Create a version 3 (namespace w/ MD5) UUID | |
| [`uuid.v4()`](#uuidv4options-buffer-offset) | Create a version 4 (random) UUID | |
| [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) | Create a version 5 (namespace w/ SHA-1) UUID | |
| [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID | New in `uuid@8.2` |
| [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID | New in `uuid@8.2` |
## API
### uuid.NIL
The nil UUID string (all zeros).
Example:
```javascript
import { v1 as uuidv1 } from 'uuid';
uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d'
import { NIL as NIL_UUID } from 'uuid';
NIL_UUID; // ⇨ '00000000-0000-0000-0000-000000000000'
```
### Create Version 3 or Version 5 (Namespace) UUIDs
### uuid.parse(str)
&#x26a0;&#xfe0f; Version 3 and Version 5 UUIDs are basically the same, differing only in the underlying hash algorithm. Note that per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_."
Convert UUID string to array of bytes
&#x26a0;&#xfe0f; If using a custom namespace **be sure to generate your own namespace UUID**. You can grab one [here](https://www.uuidgenerator.net/).
| | |
| --------- | ---------------------------------------- |
| `str` | A valid UUID `String` |
| _returns_ | `Uint8Array[16]` |
| _throws_ | `TypeError` if `str` is not a valid UUID |
Example:
```javascript
import { v5 as uuidv5 } from 'uuid'; // For version 5
import { v3 as uuidv3 } from 'uuid'; // For version 3
import { parse as uuidParse } from 'uuid';
// Using predefined DNS namespace (for domain names)
uuidv5('hello.example.com', uuidv5.DNS); // ⇨ 'fdda765f-fc57-5604-a269-52a7df8164ec'
uuidv3('hello.example.com', uuidv3.DNS); // ⇨ '9125a8dc-52ee-365b-a5aa-81b0b3681cf6'
uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨
// Uint8Array(16) [
// 110, 192, 189, 127, 17,
// 192, 67, 218, 151, 94,
// 42, 138, 217, 235, 174,
// 11
// ]
```
// Using predefined URL namespace (for URLs)
uuidv5('http://example.com/hello', uuidv5.URL); // ⇨ '3bbcee75-cecc-5b56-8031-b6641c1ed1f1'
uuidv3('http://example.com/hello', uuidv3.URL); // ⇨ 'c6235813-3ba4-3801-ae84-e0a6ebb7d138'
### uuid.stringify(arr[, offset])
// Using a custom namespace (See note, above, about generating your own
// namespace UUID)
const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341';
uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681'
uuidv3('Hello, World!', MY_NAMESPACE); // ⇨ 'e8b5a51d-11c8-3310-a6ab-367563f20686'
Convert array of bytes to UUID string
| | |
| -------------- | --------------------------------------------------------------------------- |
| `arr` | `Array`-like collection of 16 values (starting from `offset`) between 0-255 |
| [`offset` = 0] | `Number` Starting index in the Array |
| _returns_ | `String` |
| _throws_ | `TypeError` if a valid UUID string cannot be generated |
Example:
```javascript
import { stringify as uuidStringify } from 'uuid';
const uuidBytes = [110, 192, 189, 127, 17, 192, 67, 218, 151, 94, 42, 138, 217, 235, 174, 11];
uuidStringify(uuidBytes); // ⇨ '6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'
```
## API
### uuid.v1([options[, buffer[, offset]]])
### Version 4 (Random)
Create an RFC version 1 (timestamp) UUID
| | |
| --- | --- |
| [`options`] | `Object` with one or more of the following properties: |
| [`options.node` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) |
| [`options.clockseq`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff |
| [`options.msecs`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
| [`options.nsecs`] | RFC "timestamp" field (`Number` of nanseconds to add to `msecs`, should be 0-10,000) |
| [`options.random`] | `Array` of 16 random bytes (0-255) |
| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
| _throws_ | `Error` if more than 10M UUIDs/sec are requested |
Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process.
Note: `options.random` and `options.rng` are only meaningful on the very first call to `v1()`, where they may be passed to initialize the internal `node` and `clockseq` fields.
Example:
```javascript
import { v4 as uuidv4 } from 'uuid';
import { v1 as uuidv1 } from 'uuid';
// Incantations
uuidv4();
uuidv4(options);
uuidv4(options, buffer, offset);
uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d'
```
Generate and return a RFC4122 version 4 UUID.
Example using `options`:
- `options` - (Object) Optional uuid state to apply. Properties may include:
- `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values. Takes precedence over `options.rng`.
- `rng` - (Function) Random # generator function that returns an Array[16] of byte values (0-255). Alternative to `options.random`.
- `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
- `offset` - (Number) Starting index in `buffer` at which to begin writing.
```javascript
import { v1 as uuidv1 } from 'uuid';
Returns `buffer`, if specified, otherwise the string form of the UUID
const v1options = {
node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
clockseq: 0x1234,
msecs: new Date('2011-11-01').getTime(),
nsecs: 5678,
};
uuidv1(v1options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab'
```
Example: Generate string UUID with predefined `random` values
### uuid.v3(name, namespace[, buffer[, offset]])
Create an RFC version 3 (namespace w/ MD5) UUID
API is identical to `v5()`, but uses "v3" instead.
&#x26a0;&#xfe0f; Note: Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_."
### uuid.v4([options[, buffer[, offset]]])
Create an RFC version 4 (random) UUID
| | |
| --- | --- |
| [`options`] | `Object` with one or more of the following properties: |
| [`options.random`] | `Array` of 16 random bytes (0-255) |
| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
Example:
```javascript
import { v4 as uuidv4 } from 'uuid';
uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
```
Example using predefined `random` values:
```javascript
import { v4 as uuidv4 } from 'uuid';
const v4options = {

@@ -139,82 +227,29 @@ random: [

Example: Generate two IDs in a single buffer
### uuid.v5(name, namespace[, buffer[, offset]])
```javascript
const buffer = new Array();
uuidv4(null, buffer, 0); // ⇨
// [
// 27, 157, 107, 205, 187,
// 253, 75, 45, 155, 93,
// 171, 141, 251, 189, 75,
// 237
// ]
uuidv4(null, buffer, 16); // ⇨
// [
// 27, 157, 107, 205, 187, 253, 75, 45,
// 155, 93, 171, 141, 251, 189, 75, 237,
// 155, 29, 235, 77, 59, 125, 75, 173,
// 155, 221, 43, 13, 123, 61, 203, 109
// ]
```
Createa an RFC version 5 (namespace w/ SHA-1) UUID
### Version 1 (Timestamp)
| | |
| --- | --- |
| `name` | `String \| Array` |
| `namespace` | `String \| Array[16]` Namespace UUID |
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
```javascript
import { v1 as uuidv1 } from 'uuid';
Note: The RFC `DNS` and `URL` namespaces are available as `v5.DNS` and `v5.URL`.
// Incantations
uuidv1();
uuidv1(options);
uuidv1(options, buffer, offset);
```
Example with custom namespace:
Generate and return a RFC4122 version 1 (timestamp) UUID.
- `options` - (Object) Optional uuid state to apply. Properties may include:
- `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.
- `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.
- `msecs` - (Number) Time in milliseconds since unix Epoch. Default: The current time is used.
- `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.
- `random` - (Number[16]) Array of 16 numbers (0-255) to use for initialization of `node` and `clockseq` as described above. Takes precedence over `options.rng`.
- `rng` - (Function) Random # generator function that returns an Array[16] of byte values (0-255). Alternative to `options.random`.
- `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
- `offset` - (Number) Starting index in `buffer` at which to begin writing.
Returns `buffer`, if specified, otherwise the string form of the UUID
Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process.
Example: Generate string UUID with fully-specified options
```javascript
const v1options = {
node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
clockseq: 0x1234,
msecs: new Date('2011-11-01').getTime(),
nsecs: 5678,
};
uuidv1(v1options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab'
```
import { v5 as uuidv5 } from 'uuid';
Example: In-place generation of two binary IDs
// Define a custom namespace. Readers, create your own using something like
// https://www.uuidgenerator.net/
const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341';
```javascript
// Generate two ids in an array
const arr = new Array();
uuidv1(null, arr, 0); // ⇨
// [
// 44, 94, 164, 192, 64, 103,
// 17, 233, 146, 52, 155, 29,
// 235, 77, 59, 125
// ]
uuidv1(null, arr, 16); // ⇨
// [
// 44, 94, 164, 192, 64, 103, 17, 233,
// 146, 52, 155, 29, 235, 77, 59, 125,
// 44, 94, 164, 193, 64, 103, 17, 233,
// 146, 52, 155, 29, 235, 77, 59, 125
// ]
uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681'
```
### Version 5 (Namespace)
Example with RFC `URL` namespace:

@@ -224,16 +259,13 @@ ```javascript

// Incantations
uuidv5(name, namespace);
uuidv5(name, namespace, buffer);
uuidv5(name, namespace, buffer, offset);
uuidv5('https://www.w3.org/', uuidv5.URL); // ⇨ 'c106a26a-21bb-5538-8bf2-57095d1976c1'
```
Generate and return a RFC4122 version 5 UUID.
### uuid.validate(str)
- `name` - (String | Array[]) "name" to create UUID with
- `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values
- `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
- `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0
Test a string to see if it is a valid UUID
Returns `buffer`, if specified, otherwise the string form of the UUID
| | |
| --------- | --------------------------------------------------- |
| `str` | `String` to validate |
| _returns_ | `true` if string is a valid UUID, `false` otherwise |

@@ -243,26 +275,17 @@ Example:

```javascript
uuidv5('hello world', MY_NAMESPACE); // ⇨ '9f282611-e0fd-5650-8953-89c8e342da0b'
```
import { validate as uuidValidate } from 'uuid';
### Version 3 (Namespace)
&#x26a0;&#xfe0f; Note: Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_."
```javascript
import { v3 as uuidv3 } from 'uuid';
// Incantations
uuidv3(name, namespace);
uuidv3(name, namespace, buffer);
uuidv3(name, namespace, buffer, offset);
uuidValidate('not a UUID'); // ⇨ false
uuidValidate('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ true
```
Generate and return a RFC4122 version 3 UUID.
### uuid.version(str)
- `name` - (String | Array[]) "name" to create UUID with
- `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values
- `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
- `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0
Detect RFC version of a UUID
Returns `buffer`, if specified, otherwise the string form of the UUID
| | |
| --------- | ---------------------------------------- |
| `str` | A valid UUID `String` |
| _returns_ | `Number` The RFC version of the UUID |
| _throws_ | `TypeError` if `str` is not a valid UUID |

@@ -272,3 +295,6 @@ Example:

```javascript
uuidv3('hello world', MY_NAMESPACE); // ⇨ '042ffd34-d989-321c-ad06-f60826172424'
import { version as uuidVersion } from 'uuid';
uuidVersion('45637ec4-c85f-11ea-87d0-0242ac130003'); // ⇨ 1
uuidVersion('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ 4
```

@@ -352,3 +378,3 @@

These CDNs all provide the same [`uuidv4()`](#version-4-random) method:
These CDNs all provide the same [`uuidv4()`](#uuidv4options-buffer-offset) method:

@@ -361,3 +387,3 @@ ```html

Methods for the other algorithms ([`uuidv1()`](#version-1-timestamp), [`uuidv3()`](#version-3-namespace) and [`uuidv5()`](#version-5-namespace)) are available from the files `uuidv1.min.js`, `uuidv3.min.js` and `uuidv5.min.js` respectively.
Methods for the other algorithms ([`uuidv1()`](#uuidv1options-buffer-offset), [`uuidv3()`](#uuidv3name-namespace-buffer-offset) and [`uuidv5()`](#uuidv5name-namespace-buffer-offset)) are available from the files `uuidv1.min.js`, `uuidv3.min.js` and `uuidv5.min.js` respectively.

@@ -382,7 +408,7 @@ ## "getRandomValues() not supported"

## Upgrading From uuid\@7
## Upgrading From `uuid@7.x`
### Only Named Exports Supported When Using with Node.js ESM
uuid\@7 did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in Node.js ESM consequently imported the CommonJS source with a default export. This library now comes with true Node.js ESM support and only provides named exports.
`uuid@7.x` did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in Node.js ESM consequently imported the CommonJS source with a default export. This library now comes with true Node.js ESM support and only provides named exports.

@@ -405,13 +431,13 @@ Instead of doing:

Deep requires like `require('uuid/v4')` [which have been deprecated in uuid\@7](#deep-requires-now-deprecated) are no longer supported.
Deep requires like `require('uuid/v4')` [which have been deprecated in `uuid@7.x`](#deep-requires-now-deprecated) are no longer supported.
## Upgrading From uuid\@3
## Upgrading From `uuid@3.x`
"_Wait... what happened to uuid\@4 - uuid\@6?!?_"
"_Wait... what happened to `uuid@4.x` - `uuid@6.x`?!?_"
In order to avoid confusion with RFC [version 4](#version-4-random) and [version 5](#version-5-namespace) UUIDs, and a possible [version 6](http://gh.peabody.io/uuidv6/), releases 4 thru 6 of this module have been skipped. Hence, how we're now at uuid\@7.
In order to avoid confusion with RFC [version 4](#uuidv4options-buffer-offset) and [version 5](#uuidv5name-namespace-buffer-offset) UUIDs, and a possible [version 6](http://gh.peabody.io/uuidv6/), releases 4 thru 6 of this module have been skipped.
### Deep Requires Now Deprecated
uuid\@3 encouraged the use of deep requires to minimize the bundle size of browser builds:
`uuid@3.x` encouraged the use of deep requires to minimize the bundle size of browser builds:

@@ -423,3 +449,3 @@ ```javascript

As of uuid\@7 this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax:
As of `uuid@7.x` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax:

@@ -440,3 +466,3 @@ ```javascript

uuid\@3 was exporting the Version 4 UUID method as a default export:
`uuid@3.x` was exporting the Version 4 UUID method as a default export:

@@ -447,5 +473,5 @@ ```javascript

This usage pattern was already discouraged in uuid\@3 and has been removed in uuid\@7.
This usage pattern was already discouraged in `uuid@3.x` and has been removed in `uuid@7.x`.
----
Markdown generated from [README_js.md](README_js.md) by [![RunMD Logo](http://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd)
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