uuid 11.0.5 → 12.0.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 (190) hide show
  1. package/README.md +19 -30
  2. package/dist/{esm/md5.js → md5.js} +1 -1
  3. package/dist/{esm/native.d.ts → native.d.ts} +1 -1
  4. package/dist/native.js +2 -0
  5. package/dist/{esm/rng.js → rng.js} +1 -1
  6. package/dist/{esm/sha1.js → sha1.js} +1 -1
  7. package/dist/{cjs-browser/types.d.ts → types.d.ts} +1 -1
  8. package/dist/{esm/uuid-bin.js → uuid-bin.js} +1 -1
  9. package/dist/{esm-browser/v1.d.ts → v1.d.ts} +1 -1
  10. package/dist/{esm/v1.js → v1.js} +1 -1
  11. package/dist/{esm-browser/v3.d.ts → v3.d.ts} +1 -1
  12. package/dist/{cjs/v35.d.ts → v35.d.ts} +1 -1
  13. package/dist/{cjs/v4.d.ts → v4.d.ts} +1 -1
  14. package/dist/{esm-browser/v4.js → v4.js} +7 -4
  15. package/dist/{cjs/v5.d.ts → v5.d.ts} +1 -1
  16. package/dist/{esm-browser/v6.d.ts → v6.d.ts} +1 -1
  17. package/dist/{esm-browser/v7.d.ts → v7.d.ts} +1 -1
  18. package/dist/{esm-browser/v7.js → v7.js} +1 -1
  19. package/{dist/esm-browser → dist-browser}/uuid-bin.js +1 -1
  20. package/{dist/esm-browser → dist-browser}/v1.js +1 -1
  21. package/{dist/esm → dist-browser}/v4.js +7 -4
  22. package/{dist/esm → dist-browser}/v7.js +1 -1
  23. package/package.json +27 -40
  24. package/dist/cjs/index.d.ts +0 -15
  25. package/dist/cjs/index.js +0 -31
  26. package/dist/cjs/max.d.ts +0 -2
  27. package/dist/cjs/max.js +0 -3
  28. package/dist/cjs/md5.d.ts +0 -4
  29. package/dist/cjs/md5.js +0 -13
  30. package/dist/cjs/native.d.ts +0 -6
  31. package/dist/cjs/native.js +0 -4
  32. package/dist/cjs/nil.d.ts +0 -2
  33. package/dist/cjs/nil.js +0 -3
  34. package/dist/cjs/package.json +0 -1
  35. package/dist/cjs/parse.d.ts +0 -2
  36. package/dist/cjs/parse.js +0 -11
  37. package/dist/cjs/regex.d.ts +0 -2
  38. package/dist/cjs/regex.js +0 -3
  39. package/dist/cjs/rng.d.ts +0 -1
  40. package/dist/cjs/rng.js +0 -13
  41. package/dist/cjs/sha1.d.ts +0 -4
  42. package/dist/cjs/sha1.js +0 -13
  43. package/dist/cjs/stringify.d.ts +0 -3
  44. package/dist/cjs/stringify.js +0 -39
  45. package/dist/cjs/types.d.ts +0 -21
  46. package/dist/cjs/types.js +0 -2
  47. package/dist/cjs/uuid-bin.d.ts +0 -1
  48. package/dist/cjs/uuid-bin.js +0 -72
  49. package/dist/cjs/v1.d.ts +0 -11
  50. package/dist/cjs/v1.js +0 -87
  51. package/dist/cjs/v1ToV6.d.ts +0 -2
  52. package/dist/cjs/v1ToV6.js +0 -13
  53. package/dist/cjs/v3.d.ts +0 -9
  54. package/dist/cjs/v3.js +0 -14
  55. package/dist/cjs/v35.js +0 -41
  56. package/dist/cjs/v4.js +0 -29
  57. package/dist/cjs/v5.js +0 -14
  58. package/dist/cjs/v6.d.ts +0 -4
  59. package/dist/cjs/v6.js +0 -19
  60. package/dist/cjs/v6ToV1.d.ts +0 -2
  61. package/dist/cjs/v6ToV1.js +0 -13
  62. package/dist/cjs/v7.d.ts +0 -9
  63. package/dist/cjs/v7.js +0 -69
  64. package/dist/cjs/validate.d.ts +0 -2
  65. package/dist/cjs/validate.js +0 -7
  66. package/dist/cjs/version.d.ts +0 -2
  67. package/dist/cjs/version.js +0 -10
  68. package/dist/cjs-browser/index.js +0 -31
  69. package/dist/cjs-browser/max.js +0 -3
  70. package/dist/cjs-browser/md5.d.ts +0 -2
  71. package/dist/cjs-browser/md5.js +0 -137
  72. package/dist/cjs-browser/native.d.ts +0 -4
  73. package/dist/cjs-browser/native.js +0 -4
  74. package/dist/cjs-browser/nil.js +0 -3
  75. package/dist/cjs-browser/package.json +0 -1
  76. package/dist/cjs-browser/parse.js +0 -11
  77. package/dist/cjs-browser/regex.js +0 -3
  78. package/dist/cjs-browser/rng.js +0 -14
  79. package/dist/cjs-browser/sha1.d.ts +0 -2
  80. package/dist/cjs-browser/sha1.js +0 -72
  81. package/dist/cjs-browser/stringify.js +0 -39
  82. package/dist/cjs-browser/types.js +0 -2
  83. package/dist/cjs-browser/uuid-bin.js +0 -72
  84. package/dist/cjs-browser/v1.d.ts +0 -11
  85. package/dist/cjs-browser/v1.js +0 -87
  86. package/dist/cjs-browser/v1ToV6.js +0 -13
  87. package/dist/cjs-browser/v3.d.ts +0 -9
  88. package/dist/cjs-browser/v3.js +0 -14
  89. package/dist/cjs-browser/v35.d.ts +0 -7
  90. package/dist/cjs-browser/v35.js +0 -41
  91. package/dist/cjs-browser/v4.d.ts +0 -4
  92. package/dist/cjs-browser/v4.js +0 -29
  93. package/dist/cjs-browser/v5.d.ts +0 -9
  94. package/dist/cjs-browser/v5.js +0 -14
  95. package/dist/cjs-browser/v6.d.ts +0 -4
  96. package/dist/cjs-browser/v6.js +0 -19
  97. package/dist/cjs-browser/v6ToV1.js +0 -13
  98. package/dist/cjs-browser/v7.d.ts +0 -9
  99. package/dist/cjs-browser/v7.js +0 -69
  100. package/dist/cjs-browser/validate.js +0 -7
  101. package/dist/cjs-browser/version.js +0 -10
  102. package/dist/esm/index.d.ts +0 -15
  103. package/dist/esm/max.d.ts +0 -2
  104. package/dist/esm/native.js +0 -2
  105. package/dist/esm/nil.d.ts +0 -2
  106. package/dist/esm/parse.d.ts +0 -2
  107. package/dist/esm/regex.d.ts +0 -2
  108. package/dist/esm/rng.d.ts +0 -1
  109. package/dist/esm/stringify.d.ts +0 -3
  110. package/dist/esm/types.d.ts +0 -21
  111. package/dist/esm/uuid-bin.d.ts +0 -1
  112. package/dist/esm/v1.d.ts +0 -11
  113. package/dist/esm/v1ToV6.d.ts +0 -2
  114. package/dist/esm/v3.d.ts +0 -9
  115. package/dist/esm/v35.d.ts +0 -7
  116. package/dist/esm/v4.d.ts +0 -4
  117. package/dist/esm/v5.d.ts +0 -9
  118. package/dist/esm/v6.d.ts +0 -4
  119. package/dist/esm/v6ToV1.d.ts +0 -2
  120. package/dist/esm/v7.d.ts +0 -9
  121. package/dist/esm/validate.d.ts +0 -2
  122. package/dist/esm/version.d.ts +0 -2
  123. package/dist/esm-browser/index.d.ts +0 -15
  124. package/dist/esm-browser/max.d.ts +0 -2
  125. package/dist/esm-browser/md5.d.ts +0 -2
  126. package/dist/esm-browser/native.d.ts +0 -4
  127. package/dist/esm-browser/nil.d.ts +0 -2
  128. package/dist/esm-browser/parse.d.ts +0 -2
  129. package/dist/esm-browser/regex.d.ts +0 -2
  130. package/dist/esm-browser/rng.d.ts +0 -1
  131. package/dist/esm-browser/sha1.d.ts +0 -2
  132. package/dist/esm-browser/stringify.d.ts +0 -3
  133. package/dist/esm-browser/types.d.ts +0 -21
  134. package/dist/esm-browser/uuid-bin.d.ts +0 -1
  135. package/dist/esm-browser/v1ToV6.d.ts +0 -2
  136. package/dist/esm-browser/v35.d.ts +0 -7
  137. package/dist/esm-browser/v4.d.ts +0 -4
  138. package/dist/esm-browser/v5.d.ts +0 -9
  139. package/dist/esm-browser/v6ToV1.d.ts +0 -2
  140. package/dist/esm-browser/validate.d.ts +0 -2
  141. package/dist/esm-browser/version.d.ts +0 -2
  142. /package/dist/{esm/bin → bin}/uuid +0 -0
  143. /package/dist/{cjs-browser/index.d.ts → index.d.ts} +0 -0
  144. /package/dist/{esm/index.js → index.js} +0 -0
  145. /package/dist/{cjs-browser/max.d.ts → max.d.ts} +0 -0
  146. /package/dist/{esm/max.js → max.js} +0 -0
  147. /package/dist/{esm/md5.d.ts → md5.d.ts} +0 -0
  148. /package/dist/{cjs-browser/nil.d.ts → nil.d.ts} +0 -0
  149. /package/dist/{esm/nil.js → nil.js} +0 -0
  150. /package/dist/{cjs-browser/parse.d.ts → parse.d.ts} +0 -0
  151. /package/dist/{esm/parse.js → parse.js} +0 -0
  152. /package/dist/{cjs-browser/regex.d.ts → regex.d.ts} +0 -0
  153. /package/dist/{esm/regex.js → regex.js} +0 -0
  154. /package/dist/{cjs-browser/rng.d.ts → rng.d.ts} +0 -0
  155. /package/dist/{esm/sha1.d.ts → sha1.d.ts} +0 -0
  156. /package/dist/{cjs-browser/stringify.d.ts → stringify.d.ts} +0 -0
  157. /package/dist/{esm/stringify.js → stringify.js} +0 -0
  158. /package/dist/{esm/types.js → types.js} +0 -0
  159. /package/dist/{cjs-browser/uuid-bin.d.ts → uuid-bin.d.ts} +0 -0
  160. /package/dist/{cjs-browser/v1ToV6.d.ts → v1ToV6.d.ts} +0 -0
  161. /package/dist/{esm/v1ToV6.js → v1ToV6.js} +0 -0
  162. /package/dist/{esm/v3.js → v3.js} +0 -0
  163. /package/dist/{esm/v35.js → v35.js} +0 -0
  164. /package/dist/{esm/v5.js → v5.js} +0 -0
  165. /package/dist/{esm/v6.js → v6.js} +0 -0
  166. /package/dist/{cjs-browser/v6ToV1.d.ts → v6ToV1.d.ts} +0 -0
  167. /package/dist/{esm/v6ToV1.js → v6ToV1.js} +0 -0
  168. /package/dist/{cjs-browser/validate.d.ts → validate.d.ts} +0 -0
  169. /package/dist/{esm/validate.js → validate.js} +0 -0
  170. /package/dist/{cjs-browser/version.d.ts → version.d.ts} +0 -0
  171. /package/dist/{esm/version.js → version.js} +0 -0
  172. /package/{dist/esm-browser → dist-browser}/index.js +0 -0
  173. /package/{dist/esm-browser → dist-browser}/max.js +0 -0
  174. /package/{dist/esm-browser → dist-browser}/md5.js +0 -0
  175. /package/{dist/esm-browser → dist-browser}/native.js +0 -0
  176. /package/{dist/esm-browser → dist-browser}/nil.js +0 -0
  177. /package/{dist/esm-browser → dist-browser}/parse.js +0 -0
  178. /package/{dist/esm-browser → dist-browser}/regex.js +0 -0
  179. /package/{dist/esm-browser → dist-browser}/rng.js +0 -0
  180. /package/{dist/esm-browser → dist-browser}/sha1.js +0 -0
  181. /package/{dist/esm-browser → dist-browser}/stringify.js +0 -0
  182. /package/{dist/esm-browser → dist-browser}/types.js +0 -0
  183. /package/{dist/esm-browser → dist-browser}/v1ToV6.js +0 -0
  184. /package/{dist/esm-browser → dist-browser}/v3.js +0 -0
  185. /package/{dist/esm-browser → dist-browser}/v35.js +0 -0
  186. /package/{dist/esm-browser → dist-browser}/v5.js +0 -0
  187. /package/{dist/esm-browser → dist-browser}/v6.js +0 -0
  188. /package/{dist/esm-browser → dist-browser}/v6ToV1.js +0 -0
  189. /package/{dist/esm-browser → dist-browser}/validate.js +0 -0
  190. /package/{dist/esm-browser → dist-browser}/version.js +0 -0
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const parse_js_1 = require("./parse.js");
4
- const stringify_js_1 = require("./stringify.js");
5
- function v6ToV1(uuid) {
6
- const v6Bytes = typeof uuid === 'string' ? (0, parse_js_1.default)(uuid) : uuid;
7
- const v1Bytes = _v6ToV1(v6Bytes);
8
- return typeof uuid === 'string' ? (0, stringify_js_1.unsafeStringify)(v1Bytes) : v1Bytes;
9
- }
10
- exports.default = v6ToV1;
11
- function _v6ToV1(v6Bytes) {
12
- return Uint8Array.of(((v6Bytes[3] & 0x0f) << 4) | ((v6Bytes[4] >> 4) & 0x0f), ((v6Bytes[4] & 0x0f) << 4) | ((v6Bytes[5] & 0xf0) >> 4), ((v6Bytes[5] & 0x0f) << 4) | (v6Bytes[6] & 0x0f), v6Bytes[7], ((v6Bytes[1] & 0x0f) << 4) | ((v6Bytes[2] & 0xf0) >> 4), ((v6Bytes[2] & 0x0f) << 4) | ((v6Bytes[3] & 0xf0) >> 4), 0x10 | ((v6Bytes[0] & 0xf0) >> 4), ((v6Bytes[0] & 0x0f) << 4) | ((v6Bytes[1] & 0xf0) >> 4), v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]);
13
- }
@@ -1,9 +0,0 @@
1
- import { Version7Options } from './types.js';
2
- type V7State = {
3
- msecs?: number;
4
- seq?: number;
5
- };
6
- declare function v7(options?: Version7Options, buf?: undefined, offset?: number): string;
7
- declare function v7(options: Version7Options | undefined, buf: Uint8Array, offset?: number): Uint8Array;
8
- export declare function updateV7State(state: V7State, now: number, rnds: Uint8Array): V7State;
9
- export default v7;
@@ -1,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateV7State = void 0;
4
- const rng_js_1 = require("./rng.js");
5
- const stringify_js_1 = require("./stringify.js");
6
- const _state = {};
7
- function v7(options, buf, offset) {
8
- let bytes;
9
- if (options) {
10
- bytes = v7Bytes(options.random ?? options.rng?.() ?? (0, rng_js_1.default)(), options.msecs, options.seq, buf, offset);
11
- }
12
- else {
13
- const now = Date.now();
14
- const rnds = (0, rng_js_1.default)();
15
- updateV7State(_state, now, rnds);
16
- bytes = v7Bytes(rnds, _state.msecs, _state.seq, buf, offset);
17
- }
18
- return buf ? bytes : (0, stringify_js_1.unsafeStringify)(bytes);
19
- }
20
- function updateV7State(state, now, rnds) {
21
- state.msecs ??= -Infinity;
22
- state.seq ??= 0;
23
- if (now > state.msecs) {
24
- state.seq = (rnds[6] << 23) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9];
25
- state.msecs = now;
26
- }
27
- else {
28
- state.seq = (state.seq + 1) | 0;
29
- if (state.seq === 0) {
30
- state.msecs++;
31
- }
32
- }
33
- return state;
34
- }
35
- exports.updateV7State = updateV7State;
36
- function v7Bytes(rnds, msecs, seq, buf, offset = 0) {
37
- if (rnds.length < 16) {
38
- throw new Error('Random bytes length must be >= 16');
39
- }
40
- if (!buf) {
41
- buf = new Uint8Array(16);
42
- offset = 0;
43
- }
44
- else {
45
- if (offset < 0 || offset + 16 > buf.length) {
46
- throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
47
- }
48
- }
49
- msecs ??= Date.now();
50
- seq ??= ((rnds[6] * 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9];
51
- buf[offset++] = (msecs / 0x10000000000) & 0xff;
52
- buf[offset++] = (msecs / 0x100000000) & 0xff;
53
- buf[offset++] = (msecs / 0x1000000) & 0xff;
54
- buf[offset++] = (msecs / 0x10000) & 0xff;
55
- buf[offset++] = (msecs / 0x100) & 0xff;
56
- buf[offset++] = msecs & 0xff;
57
- buf[offset++] = 0x70 | ((seq >>> 28) & 0x0f);
58
- buf[offset++] = (seq >>> 20) & 0xff;
59
- buf[offset++] = 0x80 | ((seq >>> 14) & 0x3f);
60
- buf[offset++] = (seq >>> 6) & 0xff;
61
- buf[offset++] = ((seq << 2) & 0xff) | (rnds[10] & 0x03);
62
- buf[offset++] = rnds[11];
63
- buf[offset++] = rnds[12];
64
- buf[offset++] = rnds[13];
65
- buf[offset++] = rnds[14];
66
- buf[offset++] = rnds[15];
67
- return buf;
68
- }
69
- exports.default = v7;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const regex_js_1 = require("./regex.js");
4
- function validate(uuid) {
5
- return typeof uuid === 'string' && regex_js_1.default.test(uuid);
6
- }
7
- exports.default = validate;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const validate_js_1 = require("./validate.js");
4
- function version(uuid) {
5
- if (!(0, validate_js_1.default)(uuid)) {
6
- throw TypeError('Invalid UUID');
7
- }
8
- return parseInt(uuid.slice(14, 15), 16);
9
- }
10
- exports.default = version;
@@ -1,15 +0,0 @@
1
- export type * from './types.js';
2
- export { default as MAX } from './max.js';
3
- export { default as NIL } from './nil.js';
4
- export { default as parse } from './parse.js';
5
- export { default as stringify } from './stringify.js';
6
- export { default as v1 } from './v1.js';
7
- export { default as v1ToV6 } from './v1ToV6.js';
8
- export { default as v3 } from './v3.js';
9
- export { default as v4 } from './v4.js';
10
- export { default as v5 } from './v5.js';
11
- export { default as v6 } from './v6.js';
12
- export { default as v6ToV1 } from './v6ToV1.js';
13
- export { default as v7 } from './v7.js';
14
- export { default as validate } from './validate.js';
15
- export { default as version } from './version.js';
package/dist/esm/max.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const _default: "ffffffff-ffff-ffff-ffff-ffffffffffff";
2
- export default _default;
@@ -1,2 +0,0 @@
1
- import { randomUUID } from 'crypto';
2
- export default { randomUUID };
package/dist/esm/nil.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const _default: "00000000-0000-0000-0000-000000000000";
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare function parse(uuid: string): Uint8Array;
2
- export default parse;
@@ -1,2 +0,0 @@
1
- declare const _default: RegExp;
2
- export default _default;
package/dist/esm/rng.d.ts DELETED
@@ -1 +0,0 @@
1
- export default function rng(): Uint8Array;
@@ -1,3 +0,0 @@
1
- export declare function unsafeStringify(arr: Uint8Array, offset?: number): string;
2
- declare function stringify(arr: Uint8Array, offset?: number): string;
3
- export default stringify;
@@ -1,21 +0,0 @@
1
- export type UUIDTypes = string | Uint8Array;
2
- export type Version1Options = {
3
- node?: Uint8Array;
4
- clockseq?: number;
5
- random?: Uint8Array;
6
- rng?: () => Uint8Array;
7
- msecs?: number;
8
- nsecs?: number;
9
- _v6?: boolean;
10
- };
11
- export type Version4Options = {
12
- random?: Uint8Array;
13
- rng?: () => Uint8Array;
14
- };
15
- export type Version6Options = Version1Options;
16
- export type Version7Options = {
17
- random?: Uint8Array;
18
- msecs?: number;
19
- seq?: number;
20
- rng?: () => Uint8Array;
21
- };
@@ -1 +0,0 @@
1
- export {};
package/dist/esm/v1.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import { Version1Options } from './types.js';
2
- type V1State = {
3
- node?: Uint8Array;
4
- clockseq?: number;
5
- msecs?: number;
6
- nsecs?: number;
7
- };
8
- declare function v1(options?: Version1Options, buf?: undefined, offset?: number): string;
9
- declare function v1(options: Version1Options | undefined, buf: Uint8Array, offset?: number): Uint8Array;
10
- export declare function updateV1State(state: V1State, now: number, rnds: Uint8Array): V1State;
11
- export default v1;
@@ -1,2 +0,0 @@
1
- export default function v1ToV6(uuid: string): string;
2
- export default function v1ToV6(uuid: Uint8Array): Uint8Array;
package/dist/esm/v3.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import { UUIDTypes } from './types.js';
2
- export { DNS, URL } from './v35.js';
3
- declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string;
4
- declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf: Uint8Array, offset?: number): Uint8Array;
5
- declare namespace v3 {
6
- var DNS: string;
7
- var URL: string;
8
- }
9
- export default v3;
package/dist/esm/v35.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import { UUIDTypes } from './types.js';
2
- export declare function stringToBytes(str: string): Uint8Array;
3
- export declare const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
4
- export declare const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
5
- type HashFunction = (bytes: Uint8Array) => Uint8Array;
6
- export default function v35(version: 0x30 | 0x50, hash: HashFunction, value: string | Uint8Array, namespace: UUIDTypes, buf?: Uint8Array, offset?: number): string | Uint8Array;
7
- export {};
package/dist/esm/v4.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { Version4Options } from './types.js';
2
- declare function v4(options?: Version4Options, buf?: undefined, offset?: number): string;
3
- declare function v4(options: Version4Options | undefined, buf: Uint8Array, offset?: number): Uint8Array;
4
- export default v4;
package/dist/esm/v5.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import { UUIDTypes } from './types.js';
2
- export { DNS, URL } from './v35.js';
3
- declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string;
4
- declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf: Uint8Array, offset?: number): Uint8Array;
5
- declare namespace v5 {
6
- var DNS: string;
7
- var URL: string;
8
- }
9
- export default v5;
package/dist/esm/v6.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { Version6Options } from './types.js';
2
- declare function v6(options?: Version6Options, buf?: undefined, offset?: number): string;
3
- declare function v6(options: Version6Options | undefined, buf: Uint8Array, offset?: number): Uint8Array;
4
- export default v6;
@@ -1,2 +0,0 @@
1
- export default function v6ToV1(uuid: string): string;
2
- export default function v6ToV1(uuid: Uint8Array): Uint8Array;
package/dist/esm/v7.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import { Version7Options } from './types.js';
2
- type V7State = {
3
- msecs?: number;
4
- seq?: number;
5
- };
6
- declare function v7(options?: Version7Options, buf?: undefined, offset?: number): string;
7
- declare function v7(options: Version7Options | undefined, buf: Uint8Array, offset?: number): Uint8Array;
8
- export declare function updateV7State(state: V7State, now: number, rnds: Uint8Array): V7State;
9
- export default v7;
@@ -1,2 +0,0 @@
1
- declare function validate(uuid: unknown): boolean;
2
- export default validate;
@@ -1,2 +0,0 @@
1
- declare function version(uuid: string): number;
2
- export default version;
@@ -1,15 +0,0 @@
1
- export type * from './types.js';
2
- export { default as MAX } from './max.js';
3
- export { default as NIL } from './nil.js';
4
- export { default as parse } from './parse.js';
5
- export { default as stringify } from './stringify.js';
6
- export { default as v1 } from './v1.js';
7
- export { default as v1ToV6 } from './v1ToV6.js';
8
- export { default as v3 } from './v3.js';
9
- export { default as v4 } from './v4.js';
10
- export { default as v5 } from './v5.js';
11
- export { default as v6 } from './v6.js';
12
- export { default as v6ToV1 } from './v6ToV1.js';
13
- export { default as v7 } from './v7.js';
14
- export { default as validate } from './validate.js';
15
- export { default as version } from './version.js';
@@ -1,2 +0,0 @@
1
- declare const _default: "ffffffff-ffff-ffff-ffff-ffffffffffff";
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare function md5(bytes: Uint8Array): Uint8Array;
2
- export default md5;
@@ -1,4 +0,0 @@
1
- declare const _default: {
2
- randomUUID: false | (() => `${string}-${string}-${string}-${string}-${string}`);
3
- };
4
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: "00000000-0000-0000-0000-000000000000";
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare function parse(uuid: string): Uint8Array;
2
- export default parse;
@@ -1,2 +0,0 @@
1
- declare const _default: RegExp;
2
- export default _default;
@@ -1 +0,0 @@
1
- export default function rng(): Uint8Array;
@@ -1,2 +0,0 @@
1
- declare function sha1(bytes: Uint8Array): Uint8Array;
2
- export default sha1;
@@ -1,3 +0,0 @@
1
- export declare function unsafeStringify(arr: Uint8Array, offset?: number): string;
2
- declare function stringify(arr: Uint8Array, offset?: number): string;
3
- export default stringify;
@@ -1,21 +0,0 @@
1
- export type UUIDTypes = string | Uint8Array;
2
- export type Version1Options = {
3
- node?: Uint8Array;
4
- clockseq?: number;
5
- random?: Uint8Array;
6
- rng?: () => Uint8Array;
7
- msecs?: number;
8
- nsecs?: number;
9
- _v6?: boolean;
10
- };
11
- export type Version4Options = {
12
- random?: Uint8Array;
13
- rng?: () => Uint8Array;
14
- };
15
- export type Version6Options = Version1Options;
16
- export type Version7Options = {
17
- random?: Uint8Array;
18
- msecs?: number;
19
- seq?: number;
20
- rng?: () => Uint8Array;
21
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- export default function v1ToV6(uuid: string): string;
2
- export default function v1ToV6(uuid: Uint8Array): Uint8Array;
@@ -1,7 +0,0 @@
1
- import { UUIDTypes } from './types.js';
2
- export declare function stringToBytes(str: string): Uint8Array;
3
- export declare const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
4
- export declare const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
5
- type HashFunction = (bytes: Uint8Array) => Uint8Array;
6
- export default function v35(version: 0x30 | 0x50, hash: HashFunction, value: string | Uint8Array, namespace: UUIDTypes, buf?: Uint8Array, offset?: number): string | Uint8Array;
7
- export {};
@@ -1,4 +0,0 @@
1
- import { Version4Options } from './types.js';
2
- declare function v4(options?: Version4Options, buf?: undefined, offset?: number): string;
3
- declare function v4(options: Version4Options | undefined, buf: Uint8Array, offset?: number): Uint8Array;
4
- export default v4;
@@ -1,9 +0,0 @@
1
- import { UUIDTypes } from './types.js';
2
- export { DNS, URL } from './v35.js';
3
- declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string;
4
- declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf: Uint8Array, offset?: number): Uint8Array;
5
- declare namespace v5 {
6
- var DNS: string;
7
- var URL: string;
8
- }
9
- export default v5;
@@ -1,2 +0,0 @@
1
- export default function v6ToV1(uuid: string): string;
2
- export default function v6ToV1(uuid: Uint8Array): Uint8Array;
@@ -1,2 +0,0 @@
1
- declare function validate(uuid: unknown): boolean;
2
- export default validate;
@@ -1,2 +0,0 @@
1
- declare function version(uuid: string): number;
2
- export default version;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes