uuid 10.0.0 → 11.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 (347) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/README.md +71 -171
  3. package/dist/cjs/_types.d.ts +21 -0
  4. package/dist/cjs/_types.js +3 -0
  5. package/dist/cjs/index.d.ts +14 -0
  6. package/dist/cjs/index.js +32 -0
  7. package/dist/cjs/max.d.ts +2 -0
  8. package/dist/cjs/max.js +4 -0
  9. package/dist/cjs/md5.d.ts +2 -0
  10. package/dist/cjs/md5.js +14 -0
  11. package/dist/cjs/native.d.ts +5 -0
  12. package/dist/cjs/native.js +5 -0
  13. package/dist/cjs/nil.d.ts +2 -0
  14. package/dist/cjs/nil.js +4 -0
  15. package/dist/cjs/package.json +1 -0
  16. package/dist/cjs/parse.d.ts +2 -0
  17. package/dist/cjs/parse.js +12 -0
  18. package/dist/cjs/regex.d.ts +2 -0
  19. package/dist/cjs/regex.js +4 -0
  20. package/dist/cjs/rng.d.ts +1 -0
  21. package/dist/cjs/rng.js +14 -0
  22. package/dist/cjs/sha1.d.ts +2 -0
  23. package/dist/cjs/sha1.js +14 -0
  24. package/dist/cjs/stringify.d.ts +3 -0
  25. package/dist/cjs/stringify.js +39 -0
  26. package/dist/cjs/test/parse.test.d.ts +1 -0
  27. package/dist/cjs/test/parse.test.js +51 -0
  28. package/dist/cjs/test/rng.test.d.ts +1 -0
  29. package/dist/cjs/test/rng.test.js +15 -0
  30. package/dist/cjs/test/stringify.test.d.ts +1 -0
  31. package/dist/cjs/test/stringify.test.js +24 -0
  32. package/dist/cjs/test/test_constants.d.ts +33 -0
  33. package/dist/cjs/test/test_constants.js +92 -0
  34. package/dist/cjs/test/v1.test.d.ts +1 -0
  35. package/dist/cjs/test/v1.test.js +128 -0
  36. package/dist/cjs/test/v35.test.d.ts +1 -0
  37. package/dist/cjs/test/v35.test.js +144 -0
  38. package/dist/cjs/test/v4.test.d.ts +1 -0
  39. package/dist/cjs/test/v4.test.js +61 -0
  40. package/dist/cjs/test/v6.test.d.ts +1 -0
  41. package/dist/cjs/test/v6.test.js +57 -0
  42. package/dist/cjs/test/v7.test.d.ts +1 -0
  43. package/dist/cjs/test/v7.test.js +195 -0
  44. package/dist/cjs/test/validate.test.d.ts +1 -0
  45. package/dist/cjs/test/validate.test.js +14 -0
  46. package/dist/cjs/test/version.test.d.ts +1 -0
  47. package/dist/cjs/test/version.test.js +21 -0
  48. package/dist/cjs/uuid-bin.d.ts +1 -0
  49. package/dist/cjs/uuid-bin.js +73 -0
  50. package/dist/cjs/v1.d.ts +11 -0
  51. package/dist/cjs/v1.js +79 -0
  52. package/dist/cjs/v1ToV6.d.ts +2 -0
  53. package/dist/cjs/v1ToV6.js +14 -0
  54. package/dist/cjs/v3.d.ts +9 -0
  55. package/dist/cjs/v3.js +15 -0
  56. package/dist/cjs/v35.d.ts +7 -0
  57. package/dist/cjs/v35.js +42 -0
  58. package/dist/cjs/v4.d.ts +4 -0
  59. package/dist/cjs/v4.js +24 -0
  60. package/dist/cjs/v5.d.ts +9 -0
  61. package/dist/cjs/v5.js +15 -0
  62. package/dist/cjs/v6.d.ts +4 -0
  63. package/dist/cjs/v6.js +20 -0
  64. package/dist/cjs/v6ToV1.d.ts +2 -0
  65. package/dist/cjs/v6ToV1.js +14 -0
  66. package/dist/cjs/v7.d.ts +9 -0
  67. package/dist/cjs/v7.js +61 -0
  68. package/dist/cjs/validate.d.ts +2 -0
  69. package/dist/cjs/validate.js +8 -0
  70. package/dist/cjs/version.d.ts +2 -0
  71. package/dist/cjs/version.js +11 -0
  72. package/dist/cjs-browser/_types.d.ts +21 -0
  73. package/dist/cjs-browser/_types.js +3 -0
  74. package/dist/{esm-node/index.js → cjs-browser/index.d.ts} +1 -1
  75. package/dist/cjs-browser/index.js +32 -0
  76. package/dist/cjs-browser/max.d.ts +2 -0
  77. package/dist/cjs-browser/max.js +4 -0
  78. package/dist/cjs-browser/md5.d.ts +2 -0
  79. package/dist/cjs-browser/md5.js +138 -0
  80. package/dist/cjs-browser/native.d.ts +4 -0
  81. package/dist/cjs-browser/native.js +5 -0
  82. package/dist/cjs-browser/nil.d.ts +2 -0
  83. package/dist/cjs-browser/nil.js +4 -0
  84. package/dist/cjs-browser/package.json +1 -0
  85. package/dist/cjs-browser/parse.d.ts +2 -0
  86. package/dist/cjs-browser/parse.js +12 -0
  87. package/dist/cjs-browser/regex.d.ts +2 -0
  88. package/dist/cjs-browser/regex.js +4 -0
  89. package/dist/cjs-browser/rng.d.ts +1 -0
  90. package/dist/cjs-browser/rng.js +15 -0
  91. package/dist/cjs-browser/sha1.d.ts +2 -0
  92. package/dist/cjs-browser/sha1.js +73 -0
  93. package/dist/cjs-browser/stringify.d.ts +3 -0
  94. package/dist/cjs-browser/stringify.js +39 -0
  95. package/dist/cjs-browser/test/parse.test.d.ts +1 -0
  96. package/dist/cjs-browser/test/parse.test.js +51 -0
  97. package/dist/cjs-browser/test/rng.test.d.ts +1 -0
  98. package/dist/cjs-browser/test/rng.test.js +15 -0
  99. package/dist/cjs-browser/test/stringify.test.d.ts +1 -0
  100. package/dist/cjs-browser/test/stringify.test.js +24 -0
  101. package/dist/cjs-browser/test/test_constants.d.ts +33 -0
  102. package/dist/cjs-browser/test/test_constants.js +92 -0
  103. package/dist/cjs-browser/test/v1.test.d.ts +1 -0
  104. package/dist/cjs-browser/test/v1.test.js +128 -0
  105. package/dist/cjs-browser/test/v35.test.d.ts +1 -0
  106. package/dist/cjs-browser/test/v35.test.js +144 -0
  107. package/dist/cjs-browser/test/v4.test.d.ts +1 -0
  108. package/dist/cjs-browser/test/v4.test.js +61 -0
  109. package/dist/cjs-browser/test/v6.test.d.ts +1 -0
  110. package/dist/cjs-browser/test/v6.test.js +57 -0
  111. package/dist/cjs-browser/test/v7.test.d.ts +1 -0
  112. package/dist/cjs-browser/test/v7.test.js +195 -0
  113. package/dist/cjs-browser/test/validate.test.d.ts +1 -0
  114. package/dist/cjs-browser/test/validate.test.js +14 -0
  115. package/dist/cjs-browser/test/version.test.d.ts +1 -0
  116. package/dist/cjs-browser/test/version.test.js +21 -0
  117. package/dist/cjs-browser/uuid-bin.d.ts +1 -0
  118. package/dist/cjs-browser/uuid-bin.js +73 -0
  119. package/dist/cjs-browser/v1.d.ts +11 -0
  120. package/dist/cjs-browser/v1.js +79 -0
  121. package/dist/cjs-browser/v1ToV6.d.ts +2 -0
  122. package/dist/cjs-browser/v1ToV6.js +14 -0
  123. package/dist/cjs-browser/v3.d.ts +9 -0
  124. package/dist/cjs-browser/v3.js +15 -0
  125. package/dist/cjs-browser/v35.d.ts +7 -0
  126. package/dist/cjs-browser/v35.js +42 -0
  127. package/dist/cjs-browser/v4.d.ts +4 -0
  128. package/dist/cjs-browser/v4.js +24 -0
  129. package/dist/cjs-browser/v5.d.ts +9 -0
  130. package/dist/cjs-browser/v5.js +15 -0
  131. package/dist/cjs-browser/v6.d.ts +4 -0
  132. package/dist/cjs-browser/v6.js +20 -0
  133. package/dist/cjs-browser/v6ToV1.d.ts +2 -0
  134. package/dist/cjs-browser/v6ToV1.js +14 -0
  135. package/dist/cjs-browser/v7.d.ts +9 -0
  136. package/dist/cjs-browser/v7.js +61 -0
  137. package/dist/cjs-browser/validate.d.ts +2 -0
  138. package/dist/cjs-browser/validate.js +8 -0
  139. package/dist/cjs-browser/version.d.ts +2 -0
  140. package/dist/cjs-browser/version.js +11 -0
  141. package/dist/esm/_types.d.ts +21 -0
  142. package/dist/esm/_types.js +2 -0
  143. package/dist/esm/bin/uuid +2 -0
  144. package/dist/esm/index.d.ts +14 -0
  145. package/dist/esm/index.js +15 -0
  146. package/dist/esm/max.d.ts +2 -0
  147. package/dist/esm/max.js +2 -0
  148. package/dist/esm/md5.d.ts +2 -0
  149. package/dist/esm/md5.js +12 -0
  150. package/dist/esm/native.d.ts +5 -0
  151. package/dist/esm/native.js +3 -0
  152. package/dist/esm/nil.d.ts +2 -0
  153. package/dist/esm/nil.js +2 -0
  154. package/dist/esm/parse.d.ts +2 -0
  155. package/dist/esm/parse.js +10 -0
  156. package/dist/esm/regex.d.ts +2 -0
  157. package/dist/esm/regex.js +2 -0
  158. package/dist/esm/rng.d.ts +1 -0
  159. package/dist/esm/rng.js +11 -0
  160. package/dist/esm/sha1.d.ts +2 -0
  161. package/dist/esm/sha1.js +12 -0
  162. package/dist/esm/stringify.d.ts +3 -0
  163. package/dist/esm/stringify.js +36 -0
  164. package/dist/esm/test/parse.test.d.ts +1 -0
  165. package/dist/esm/test/parse.test.js +49 -0
  166. package/dist/esm/test/rng.test.d.ts +1 -0
  167. package/dist/esm/test/rng.test.js +13 -0
  168. package/dist/esm/test/stringify.test.d.ts +1 -0
  169. package/dist/esm/test/stringify.test.js +22 -0
  170. package/dist/esm/test/test_constants.d.ts +33 -0
  171. package/dist/esm/test/test_constants.js +89 -0
  172. package/dist/esm/test/v1.test.d.ts +1 -0
  173. package/dist/esm/test/v1.test.js +126 -0
  174. package/dist/esm/test/v35.test.d.ts +1 -0
  175. package/dist/esm/test/v35.test.js +142 -0
  176. package/dist/esm/test/v4.test.d.ts +1 -0
  177. package/dist/esm/test/v4.test.js +59 -0
  178. package/dist/esm/test/v6.test.d.ts +1 -0
  179. package/dist/esm/test/v6.test.js +55 -0
  180. package/dist/esm/test/v7.test.d.ts +1 -0
  181. package/dist/esm/test/v7.test.js +193 -0
  182. package/dist/esm/test/validate.test.d.ts +1 -0
  183. package/dist/esm/test/validate.test.js +12 -0
  184. package/dist/esm/test/version.test.d.ts +1 -0
  185. package/dist/esm/test/version.test.js +19 -0
  186. package/dist/esm/uuid-bin.d.ts +1 -0
  187. package/dist/esm/uuid-bin.js +71 -0
  188. package/dist/esm/v1.d.ts +11 -0
  189. package/dist/esm/v1.js +76 -0
  190. package/dist/esm/v1ToV6.d.ts +2 -0
  191. package/dist/esm/v1ToV6.js +11 -0
  192. package/dist/esm/v3.d.ts +9 -0
  193. package/dist/esm/v3.js +10 -0
  194. package/dist/esm/v35.d.ts +7 -0
  195. package/dist/esm/v35.js +37 -0
  196. package/dist/esm/v4.d.ts +4 -0
  197. package/dist/esm/v4.js +22 -0
  198. package/dist/esm/v5.d.ts +9 -0
  199. package/dist/esm/v5.js +10 -0
  200. package/dist/esm/v6.d.ts +4 -0
  201. package/dist/esm/v6.js +18 -0
  202. package/dist/esm/v6ToV1.d.ts +2 -0
  203. package/dist/esm/v6ToV1.js +11 -0
  204. package/dist/esm/v7.d.ts +9 -0
  205. package/dist/esm/v7.js +58 -0
  206. package/dist/esm/validate.d.ts +2 -0
  207. package/dist/esm/validate.js +6 -0
  208. package/dist/esm/version.d.ts +2 -0
  209. package/dist/esm/version.js +9 -0
  210. package/dist/esm-browser/_types.d.ts +21 -0
  211. package/dist/esm-browser/_types.js +2 -0
  212. package/dist/esm-browser/index.d.ts +14 -0
  213. package/dist/esm-browser/index.js +2 -1
  214. package/dist/esm-browser/max.d.ts +2 -0
  215. package/dist/esm-browser/max.js +2 -1
  216. package/dist/esm-browser/md5.d.ts +2 -0
  217. package/dist/esm-browser/md5.js +114 -172
  218. package/dist/esm-browser/native.d.ts +4 -0
  219. package/dist/esm-browser/native.js +3 -4
  220. package/dist/esm-browser/nil.d.ts +2 -0
  221. package/dist/esm-browser/nil.js +2 -1
  222. package/dist/esm-browser/parse.d.ts +2 -0
  223. package/dist/esm-browser/parse.js +7 -34
  224. package/dist/esm-browser/regex.d.ts +2 -0
  225. package/dist/esm-browser/regex.js +2 -1
  226. package/dist/esm-browser/rng.d.ts +1 -0
  227. package/dist/esm-browser/rng.js +9 -14
  228. package/dist/esm-browser/sha1.d.ts +2 -0
  229. package/dist/esm-browser/sha1.js +63 -68
  230. package/dist/esm-browser/stringify.d.ts +3 -0
  231. package/dist/esm-browser/stringify.js +30 -25
  232. package/dist/esm-browser/test/parse.test.d.ts +1 -0
  233. package/dist/esm-browser/test/parse.test.js +49 -0
  234. package/dist/esm-browser/test/rng.test.d.ts +1 -0
  235. package/dist/esm-browser/test/rng.test.js +13 -0
  236. package/dist/esm-browser/test/stringify.test.d.ts +1 -0
  237. package/dist/esm-browser/test/stringify.test.js +22 -0
  238. package/dist/esm-browser/test/test_constants.d.ts +33 -0
  239. package/dist/esm-browser/test/test_constants.js +89 -0
  240. package/dist/esm-browser/test/v1.test.d.ts +1 -0
  241. package/dist/esm-browser/test/v1.test.js +126 -0
  242. package/dist/esm-browser/test/v35.test.d.ts +1 -0
  243. package/dist/esm-browser/test/v35.test.js +142 -0
  244. package/dist/esm-browser/test/v4.test.d.ts +1 -0
  245. package/dist/esm-browser/test/v4.test.js +59 -0
  246. package/dist/esm-browser/test/v6.test.d.ts +1 -0
  247. package/dist/esm-browser/test/v6.test.js +55 -0
  248. package/dist/esm-browser/test/v7.test.d.ts +1 -0
  249. package/dist/esm-browser/test/v7.test.js +193 -0
  250. package/dist/esm-browser/test/validate.test.d.ts +1 -0
  251. package/dist/esm-browser/test/validate.test.js +12 -0
  252. package/dist/esm-browser/test/version.test.d.ts +1 -0
  253. package/dist/esm-browser/test/version.test.js +19 -0
  254. package/dist/esm-browser/uuid-bin.d.ts +1 -0
  255. package/dist/esm-browser/uuid-bin.js +71 -0
  256. package/dist/esm-browser/v1.d.ts +11 -0
  257. package/dist/esm-browser/v1.js +68 -117
  258. package/dist/esm-browser/v1ToV6.d.ts +2 -0
  259. package/dist/esm-browser/v1ToV6.js +7 -16
  260. package/dist/esm-browser/v3.d.ts +9 -0
  261. package/dist/esm-browser/v3.js +9 -3
  262. package/dist/esm-browser/v35.d.ts +7 -0
  263. package/dist/esm-browser/v35.js +29 -47
  264. package/dist/esm-browser/v4.d.ts +4 -0
  265. package/dist/esm-browser/v4.js +16 -19
  266. package/dist/esm-browser/v5.d.ts +9 -0
  267. package/dist/esm-browser/v5.js +9 -3
  268. package/dist/esm-browser/v6.d.ts +4 -0
  269. package/dist/esm-browser/v6.js +14 -32
  270. package/dist/esm-browser/v6ToV1.d.ts +2 -0
  271. package/dist/esm-browser/v6ToV1.js +6 -15
  272. package/dist/esm-browser/v7.d.ts +9 -0
  273. package/dist/esm-browser/v7.js +51 -139
  274. package/dist/esm-browser/validate.d.ts +2 -0
  275. package/dist/esm-browser/validate.js +3 -2
  276. package/dist/esm-browser/version.d.ts +2 -0
  277. package/dist/esm-browser/version.js +6 -5
  278. package/package.json +54 -64
  279. package/wrapper.mjs +1 -1
  280. package/dist/bin/uuid +0 -2
  281. package/dist/commonjs-browser/index.js +0 -104
  282. package/dist/commonjs-browser/max.js +0 -7
  283. package/dist/commonjs-browser/md5.js +0 -200
  284. package/dist/commonjs-browser/native.js +0 -10
  285. package/dist/commonjs-browser/nil.js +0 -7
  286. package/dist/commonjs-browser/parse.js +0 -44
  287. package/dist/commonjs-browser/regex.js +0 -7
  288. package/dist/commonjs-browser/rng.js +0 -23
  289. package/dist/commonjs-browser/sha1.js +0 -82
  290. package/dist/commonjs-browser/stringify.js +0 -38
  291. package/dist/commonjs-browser/v1.js +0 -131
  292. package/dist/commonjs-browser/v1ToV6.js +0 -26
  293. package/dist/commonjs-browser/v3.js +0 -11
  294. package/dist/commonjs-browser/v35.js +0 -63
  295. package/dist/commonjs-browser/v4.js +0 -32
  296. package/dist/commonjs-browser/v5.js +0 -11
  297. package/dist/commonjs-browser/v6.js +0 -42
  298. package/dist/commonjs-browser/v6ToV1.js +0 -26
  299. package/dist/commonjs-browser/v7.js +0 -152
  300. package/dist/commonjs-browser/validate.js +0 -12
  301. package/dist/commonjs-browser/version.js +0 -15
  302. package/dist/esm-node/max.js +0 -1
  303. package/dist/esm-node/md5.js +0 -10
  304. package/dist/esm-node/native.js +0 -4
  305. package/dist/esm-node/nil.js +0 -1
  306. package/dist/esm-node/parse.js +0 -37
  307. package/dist/esm-node/regex.js +0 -1
  308. package/dist/esm-node/rng.js +0 -10
  309. package/dist/esm-node/sha1.js +0 -10
  310. package/dist/esm-node/stringify.js +0 -31
  311. package/dist/esm-node/v1.js +0 -125
  312. package/dist/esm-node/v1ToV6.js +0 -20
  313. package/dist/esm-node/v3.js +0 -4
  314. package/dist/esm-node/v35.js +0 -55
  315. package/dist/esm-node/v4.js +0 -25
  316. package/dist/esm-node/v5.js +0 -4
  317. package/dist/esm-node/v6.js +0 -32
  318. package/dist/esm-node/v6ToV1.js +0 -20
  319. package/dist/esm-node/v7.js +0 -146
  320. package/dist/esm-node/validate.js +0 -5
  321. package/dist/esm-node/version.js +0 -8
  322. package/dist/index.js +0 -104
  323. package/dist/max.js +0 -7
  324. package/dist/md5-browser.js +0 -200
  325. package/dist/md5.js +0 -17
  326. package/dist/native-browser.js +0 -10
  327. package/dist/native.js +0 -11
  328. package/dist/nil.js +0 -7
  329. package/dist/parse.js +0 -44
  330. package/dist/regex.js +0 -7
  331. package/dist/rng-browser.js +0 -23
  332. package/dist/rng.js +0 -17
  333. package/dist/sha1-browser.js +0 -82
  334. package/dist/sha1.js +0 -17
  335. package/dist/stringify.js +0 -38
  336. package/dist/uuid-bin.js +0 -75
  337. package/dist/v1.js +0 -131
  338. package/dist/v1ToV6.js +0 -26
  339. package/dist/v3.js +0 -11
  340. package/dist/v35.js +0 -63
  341. package/dist/v4.js +0 -32
  342. package/dist/v5.js +0 -11
  343. package/dist/v6.js +0 -38
  344. package/dist/v6ToV1.js +0 -26
  345. package/dist/v7.js +0 -152
  346. package/dist/validate.js +0 -12
  347. package/dist/version.js +0 -15
package/CHANGELOG.md CHANGED
@@ -2,6 +2,176 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [11.0.0](https://github.com/uuidjs/uuid/compare/v11.0.0...v11.0.0) (2024-10-27)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * refactor v1 internal state and options logic ([#780](https://github.com/uuidjs/uuid/issues/780))
11
+ * refactor v7 internal state and options logic, fixes #764 ([#779](https://github.com/uuidjs/uuid/issues/779))
12
+ * Port to TypeScript, closes #762 ([#763](https://github.com/uuidjs/uuid/issues/763))
13
+ * update node support matrix (only support node 16-20) ([#750](https://github.com/uuidjs/uuid/issues/750))
14
+ * This library always aims at supporting one EOLed LTS release which by this time now is 12.x which has reached EOL 30 Apr 2022.
15
+ * Remove the minified UMD build from the package.
16
+ * Drop support for browsers that don't correctly implement const/let and default arguments, and no longer transpile the browser build to ES2015.
17
+ * Although in practice this is currently a noop since the resulting build does not change, the build will no longer transpiles future changes for Node.js 8.x targets, so semantically this is still a breaking change.
18
+ * Deep requiring specific algorithms of this library like require('uuid/v4'), which has been deprecated in uuid@7, is no longer supported.
19
+ * The default export, which used to be the v4() method but which was already discouraged in v3.x of this library, has been removed.
20
+ * Explicitly note that deep imports of the different uuid version functions are deprecated and no longer encouraged and that ECMAScript module named imports should be used instead. Emit a deprecation warning for people who deep-require the different algorithm variants.
21
+ * Remove builtin support for insecure random number generators in the browser. Users who want that will have to supply their own random number generator function.
22
+ * Remove support for generating v3 and v5 UUIDs in Node.js<4.x
23
+ * Convert code base to ECMAScript Modules (ESM) and release CommonJS build for node and ESM build for browser bundlers.
24
+
25
+ ### Features
26
+
27
+ * add parse/stringify/validate/version/NIL APIs ([#479](https://github.com/uuidjs/uuid/issues/479)) ([0e6c10b](https://github.com/uuidjs/uuid/commit/0e6c10ba1bf9517796ff23c052fc0468eedfd5f4))
28
+ * add support for MAX uuid (new in RFC9562) ([#714](https://github.com/uuidjs/uuid/issues/714)) ([0385cd3](https://github.com/uuidjs/uuid/commit/0385cd3f18ae9920678b2849932fa7a9d9aee7d0))
29
+ * add UMD build to npm package ([#357](https://github.com/uuidjs/uuid/issues/357)) ([4e75adf](https://github.com/uuidjs/uuid/commit/4e75adf435196f28e3fbbe0185d654b5ded7ca2c))
30
+ * add various es module and CommonJS examples ([b238510](https://github.com/uuidjs/uuid/commit/b238510bf352463521f74bab175a3af9b7a42555))
31
+ * enforce Conventional Commit style commit messages ([#282](https://github.com/uuidjs/uuid/issues/282)) ([0705cd5](https://github.com/uuidjs/uuid/commit/0705cd5bae3ab07415294e5544901ffcf0ad4e23))
32
+ * ensure that docs are up-to-date in CI ([ee5e77d](https://github.com/uuidjs/uuid/commit/ee5e77db547474f5a8f23d6c857a6d399209986b))
33
+ * hybrid CommonJS & ECMAScript modules build ([a3f078f](https://github.com/uuidjs/uuid/commit/a3f078faa0baff69ab41aed08e041f8f9c8993d0))
34
+ * improve performance of v1 string representation ([#453](https://github.com/uuidjs/uuid/issues/453)) ([0ee0b67](https://github.com/uuidjs/uuid/commit/0ee0b67c37846529c66089880414d29f3ae132d5))
35
+ * improve v4 performance by reusing random number array ([#435](https://github.com/uuidjs/uuid/issues/435)) ([bf4af0d](https://github.com/uuidjs/uuid/commit/bf4af0d711b4d2ed03d1f74fd12ad0baa87dc79d))
36
+ * optimize uuid.v1 by 1.3x uuid.v4 by 4.3x (430%) ([#597](https://github.com/uuidjs/uuid/issues/597)) ([3a033f6](https://github.com/uuidjs/uuid/commit/3a033f6bab6bb3780ece6d645b902548043280bc))
37
+ * optimize V8 performance of bytesToUuid ([#434](https://github.com/uuidjs/uuid/issues/434)) ([e156415](https://github.com/uuidjs/uuid/commit/e156415448ec1af2351fa0b6660cfb22581971f2))
38
+ * Port to TypeScript, closes [#762](https://github.com/uuidjs/uuid/issues/762) ([#763](https://github.com/uuidjs/uuid/issues/763)) ([1e0f987](https://github.com/uuidjs/uuid/commit/1e0f9870db864ca93f7a69db0d468b5e1b7605e7))
39
+ * remove deep requires ([#426](https://github.com/uuidjs/uuid/issues/426)) ([daf72b8](https://github.com/uuidjs/uuid/commit/daf72b84ceb20272a81bb5fbddb05dd95922cbba))
40
+ * remove deprecated v4 string parameter ([#454](https://github.com/uuidjs/uuid/issues/454)) ([88ce3ca](https://github.com/uuidjs/uuid/commit/88ce3ca0ba046f60856de62c7ce03f7ba98ba46c))
41
+ * remove insecure fallback random number generator ([3a5842b](https://github.com/uuidjs/uuid/commit/3a5842b141a6e5de0ae338f391661e6b84b167c9))
42
+ * remove support for pre Node.js v4 Buffer API ([#356](https://github.com/uuidjs/uuid/issues/356)) ([b59b5c5](https://github.com/uuidjs/uuid/commit/b59b5c5ecad271c5453f1a156f011671f6d35627))
43
+ * remove UMD build ([#645](https://github.com/uuidjs/uuid/issues/645)) ([e948a0f](https://github.com/uuidjs/uuid/commit/e948a0f22bf22f4619b27bd913885e478e20fe6f)), closes [#620](https://github.com/uuidjs/uuid/issues/620)
44
+ * rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([c37a518](https://github.com/uuidjs/uuid/commit/c37a518e367ac4b6d0aa62dba1bc6ce9e85020f7)), closes [#338](https://github.com/uuidjs/uuid/issues/338)
45
+ * rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([e2d7314](https://github.com/uuidjs/uuid/commit/e2d731463b680c5b816d144f66feef902586410e)), closes [#338](https://github.com/uuidjs/uuid/issues/338)
46
+ * support v6 uuids ([#754](https://github.com/uuidjs/uuid/issues/754)) ([c4ed13e](https://github.com/uuidjs/uuid/commit/c4ed13e7159d87c9e42a349bdd9dc955f1af46b6))
47
+ * update node support matrix (only support node 16-20) ([#750](https://github.com/uuidjs/uuid/issues/750)) ([883b163](https://github.com/uuidjs/uuid/commit/883b163b9ab9d6655bfbd8a35e61a3c71674dfe1))
48
+ * use native crypto.randomUUID when available ([#600](https://github.com/uuidjs/uuid/issues/600)) ([c9e076c](https://github.com/uuidjs/uuid/commit/c9e076c852edad7e9a06baaa1d148cf4eda6c6c4))
49
+ * v8 support ([#759](https://github.com/uuidjs/uuid/issues/759)) ([35a5342](https://github.com/uuidjs/uuid/commit/35a53428202657e402e6b4aa68f56c08194541bf))
50
+
51
+
52
+ ### Bug Fixes
53
+
54
+ * 248 ([#251](https://github.com/uuidjs/uuid/issues/251)) ([67d697c](https://github.com/uuidjs/uuid/commit/67d697cd83580a5be090eb18c935da2e402c5657))
55
+ * 30, _rb not defined for lesser node.js versions ([8a6c03f](https://github.com/uuidjs/uuid/commit/8a6c03f969b3332846159312dc583d1746609eea))
56
+ * add CommonJS syntax example to README quickstart section ([#417](https://github.com/uuidjs/uuid/issues/417)) ([e0ec840](https://github.com/uuidjs/uuid/commit/e0ec8402c7ad44b7ef0453036c612f5db513fda0))
57
+ * add deep-require proxies for local testing and adjust tests ([#365](https://github.com/uuidjs/uuid/issues/365)) ([7fedc79](https://github.com/uuidjs/uuid/commit/7fedc79ac8fda4bfd1c566c7f05ef4ac13b2db48))
58
+ * add Jest/jsdom compatibility ([#642](https://github.com/uuidjs/uuid/issues/642)) ([16f9c46](https://github.com/uuidjs/uuid/commit/16f9c469edf46f0786164cdf4dc980743984a6fd))
59
+ * add missing exports and tests for new APIs ([#495](https://github.com/uuidjs/uuid/issues/495)) ([681e1da](https://github.com/uuidjs/uuid/commit/681e1dabfb21314e6b11a564ed6d3d1fa558dcd7))
60
+ * assignment to readonly property to allow running in strict mode ([#270](https://github.com/uuidjs/uuid/issues/270)) ([d062fdc](https://github.com/uuidjs/uuid/commit/d062fdc14aae6980cbd6c8350c4af70c1db30b0f))
61
+ * change default export to named function ([#545](https://github.com/uuidjs/uuid/issues/545)) ([c57bc5a](https://github.com/uuidjs/uuid/commit/c57bc5a9a0653273aa639cda9177ce52efabe42a))
62
+ * clean up esm builds for node and browser ([#383](https://github.com/uuidjs/uuid/issues/383)) ([59e6a49](https://github.com/uuidjs/uuid/commit/59e6a49e7ce7b3e8fb0f3ee52b9daae72af467dc))
63
+ * export package.json required by react-native and bundlers ([#449](https://github.com/uuidjs/uuid/issues/449)) ([be1c8fe](https://github.com/uuidjs/uuid/commit/be1c8fe9a3206c358e0059b52fafd7213aa48a52)), closes [#444](https://github.com/uuidjs/uuid/issues/444)
64
+ * fix [#229](https://github.com/uuidjs/uuid/issues/229) ([d9033cf](https://github.com/uuidjs/uuid/commit/d9033cf35881c867aa028b851d1da80bb47ddfb1))
65
+ * fix [#284](https://github.com/uuidjs/uuid/issues/284) by setting function name in try-catch ([f2a60f2](https://github.com/uuidjs/uuid/commit/f2a60f2fcdd7957cc7ae201165377af698e5b0ef))
66
+ * Get correct version of IE11 crypto ([#274](https://github.com/uuidjs/uuid/issues/274)) ([205e0ed](https://github.com/uuidjs/uuid/commit/205e0ed1f710199e4afbc3480da58e042d899b11))
67
+ * handle error when parameter is not set in v3 and v5 ([#622](https://github.com/uuidjs/uuid/issues/622)) ([fcd7388](https://github.com/uuidjs/uuid/commit/fcd73881692d9fabb63872576ba28e30ff852091))
68
+ * lazy load getRandomValues ([#537](https://github.com/uuidjs/uuid/issues/537)) ([16c8f6d](https://github.com/uuidjs/uuid/commit/16c8f6df2f6b09b4d6235602d6a591188320a82e)), closes [#536](https://github.com/uuidjs/uuid/issues/536)
69
+ * make access to msCrypto consistent ([#393](https://github.com/uuidjs/uuid/issues/393)) ([8bf2a20](https://github.com/uuidjs/uuid/commit/8bf2a20f3565df743da7215eebdbada9d2df118c))
70
+ * make deep require deprecation warning work in browsers ([#409](https://github.com/uuidjs/uuid/issues/409)) ([4b71107](https://github.com/uuidjs/uuid/commit/4b71107d8c0d2ef56861ede6403fc9dc35a1e6bf))
71
+ * mem issue when generating uuid ([#267](https://github.com/uuidjs/uuid/issues/267)) ([c47702c](https://github.com/uuidjs/uuid/commit/c47702c29172e70a5da5650ba905c067d37f3658))
72
+ * missing v7 expectations in browser spec ([#751](https://github.com/uuidjs/uuid/issues/751)) ([f54a866](https://github.com/uuidjs/uuid/commit/f54a866cedb2b3b96581157c1f4ac935a0b11411))
73
+ * prepare package exports for webpack 5 ([#468](https://github.com/uuidjs/uuid/issues/468)) ([8d6e6a5](https://github.com/uuidjs/uuid/commit/8d6e6a5f8965ca9575eb4d92e99a43435f4a58a8))
74
+ * provide browser versions independent from module system ([#380](https://github.com/uuidjs/uuid/issues/380)) ([4344a22](https://github.com/uuidjs/uuid/commit/4344a22e7aed33be8627eeaaf05360f256a21753))
75
+ * refactor v1 internal state and options logic ([#780](https://github.com/uuidjs/uuid/issues/780)) ([031b3d3](https://github.com/uuidjs/uuid/commit/031b3d3d738bc6694501ac0a37152b95ed500989))
76
+ * refactor v7 internal state and options logic, fixes [#764](https://github.com/uuidjs/uuid/issues/764) ([#779](https://github.com/uuidjs/uuid/issues/779)) ([9dbd1cd](https://github.com/uuidjs/uuid/commit/9dbd1cd4177c43fcaac961a3b16fb2d044c9940a))
77
+ * remove v4 options default assignment preventing native.randomUUID from being used ([#786](https://github.com/uuidjs/uuid/issues/786)) ([afe6232](https://github.com/uuidjs/uuid/commit/afe62323c4408a824755a39d7b971a8ae06f7199))
78
+ * revert "perf: remove superfluous call to toLowerCase ([#677](https://github.com/uuidjs/uuid/issues/677))" ([#738](https://github.com/uuidjs/uuid/issues/738)) ([e267b90](https://github.com/uuidjs/uuid/commit/e267b9073df1d0ce119ee53c0487fe76acb2be37))
79
+ * run npm audit fix ([#644](https://github.com/uuidjs/uuid/issues/644)) ([04686f5](https://github.com/uuidjs/uuid/commit/04686f54c5fed2cfffc1b619f4970c4bb8532353))
80
+ * seq_hi shift for byte 6 ([#775](https://github.com/uuidjs/uuid/issues/775)) ([1d532ca](https://github.com/uuidjs/uuid/commit/1d532ca374f181932a24a83fa98f71a5bd4f3e96))
81
+ * simplify link in deprecation warning ([#391](https://github.com/uuidjs/uuid/issues/391)) ([bb2c8e4](https://github.com/uuidjs/uuid/commit/bb2c8e4e9f4c5f9c1eaaf3ea59710c633cd90cb7))
82
+ * support expo&gt;=39.0.0 ([#515](https://github.com/uuidjs/uuid/issues/515)) ([c65a0f3](https://github.com/uuidjs/uuid/commit/c65a0f3fa73b901959d638d1e3591dfacdbed867)), closes [#375](https://github.com/uuidjs/uuid/issues/375)
83
+ * tsconfig module type ([#778](https://github.com/uuidjs/uuid/issues/778)) ([7eff835](https://github.com/uuidjs/uuid/commit/7eff835cba334ad418f57768c00d15b918a9b419))
84
+ * typo ([305d877](https://github.com/uuidjs/uuid/commit/305d87779000d9b0e40ab4d481eb3b79c5965607))
85
+ * update links to match content in readme ([#386](https://github.com/uuidjs/uuid/issues/386)) ([44f2f86](https://github.com/uuidjs/uuid/commit/44f2f86e9d2bbf14ee5f0f00f72a3db1292666d4))
86
+ * upgrading from uuid3 broken link ([#568](https://github.com/uuidjs/uuid/issues/568)) ([1c849da](https://github.com/uuidjs/uuid/commit/1c849da6e164259e72e18636726345b13a7eddd6))
87
+ * use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18baf249867ad12bc35f5a239e5339073758))
88
+
89
+
90
+ ### Performance Improvements
91
+
92
+ * **nodejs:** introduce pool into default rng ([#513](https://github.com/uuidjs/uuid/issues/513)) ([7f1af04](https://github.com/uuidjs/uuid/commit/7f1af044be4a21c5cc41e410b3bb86048be14093))
93
+ * remove superfluous call to toLowerCase ([#677](https://github.com/uuidjs/uuid/issues/677)) ([e53793f](https://github.com/uuidjs/uuid/commit/e53793f5be93413cad68b05b3a339ca23e993342))
94
+
95
+
96
+ ### Documentation
97
+
98
+ * add note about removal of default export ([#372](https://github.com/uuidjs/uuid/issues/372)) ([12749b7](https://github.com/uuidjs/uuid/commit/12749b700eb49db8a9759fd306d8be05dbfbd58c)), closes [#370](https://github.com/uuidjs/uuid/issues/370)
99
+ * deprecated deep requiring of the different algorithm versions ([#361](https://github.com/uuidjs/uuid/issues/361)) ([c0bdf15](https://github.com/uuidjs/uuid/commit/c0bdf15e417639b1aeb0b247b2fb11f7a0a26b23))
100
+
101
+
102
+ ### Miscellaneous Chores
103
+
104
+ * drop node 10.x to upgrade dev dependencies ([#653](https://github.com/uuidjs/uuid/issues/653)) ([28a5712](https://github.com/uuidjs/uuid/commit/28a571283f8abda6b9d85e689f95b7d3ee9e282e))
105
+ * release 11.0.0 ([#805](https://github.com/uuidjs/uuid/issues/805)) ([b003cde](https://github.com/uuidjs/uuid/commit/b003cdeda4c6a7ab525f79b9a3d87d1395a1fb4e))
106
+
107
+
108
+ ### Build System
109
+
110
+ * drop Node.js 8.x from babel transpile target ([#603](https://github.com/uuidjs/uuid/issues/603)) ([aa11485](https://github.com/uuidjs/uuid/commit/aa114858260402107ec8a1e1a825dea0a259bcb5))
111
+ * drop support for legacy browsers (IE11, Safari 10) ([#604](https://github.com/uuidjs/uuid/issues/604)) ([0f433e5](https://github.com/uuidjs/uuid/commit/0f433e5ec444edacd53016de67db021102f36148))
112
+
113
+ ## [11.0.0](https://github.com/uuidjs/uuid/compare/v9.0.0...v11.0.0) (2024-10-27)
114
+
115
+
116
+ ### ⚠ BREAKING CHANGES
117
+
118
+ * refactor v1 internal state and options logic ([#780](https://github.com/uuidjs/uuid/issues/780))
119
+ * refactor v7 internal state and options logic, fixes #764 ([#779](https://github.com/uuidjs/uuid/issues/779))
120
+ * Port to TypeScript, closes #762 ([#763](https://github.com/uuidjs/uuid/issues/763))
121
+ * update node support matrix (only support node 16-20) ([#750](https://github.com/uuidjs/uuid/issues/750))
122
+
123
+ ### Features
124
+
125
+ * add support for MAX uuid (new in RFC9562) ([#714](https://github.com/uuidjs/uuid/issues/714)) ([0385cd3](https://github.com/uuidjs/uuid/commit/0385cd3f18ae9920678b2849932fa7a9d9aee7d0))
126
+ * Port to TypeScript, closes [#762](https://github.com/uuidjs/uuid/issues/762) ([#763](https://github.com/uuidjs/uuid/issues/763)) ([1e0f987](https://github.com/uuidjs/uuid/commit/1e0f9870db864ca93f7a69db0d468b5e1b7605e7))
127
+ * support v6 uuids ([#754](https://github.com/uuidjs/uuid/issues/754)) ([c4ed13e](https://github.com/uuidjs/uuid/commit/c4ed13e7159d87c9e42a349bdd9dc955f1af46b6))
128
+ * update node support matrix (only support node 16-20) ([#750](https://github.com/uuidjs/uuid/issues/750)) ([883b163](https://github.com/uuidjs/uuid/commit/883b163b9ab9d6655bfbd8a35e61a3c71674dfe1))
129
+ * v8 support ([#759](https://github.com/uuidjs/uuid/issues/759)) ([35a5342](https://github.com/uuidjs/uuid/commit/35a53428202657e402e6b4aa68f56c08194541bf))
130
+
131
+
132
+ ### Bug Fixes
133
+
134
+ * missing v7 expectations in browser spec ([#751](https://github.com/uuidjs/uuid/issues/751)) ([f54a866](https://github.com/uuidjs/uuid/commit/f54a866cedb2b3b96581157c1f4ac935a0b11411))
135
+ * refactor v1 internal state and options logic ([#780](https://github.com/uuidjs/uuid/issues/780)) ([031b3d3](https://github.com/uuidjs/uuid/commit/031b3d3d738bc6694501ac0a37152b95ed500989))
136
+ * refactor v7 internal state and options logic, fixes [#764](https://github.com/uuidjs/uuid/issues/764) ([#779](https://github.com/uuidjs/uuid/issues/779)) ([9dbd1cd](https://github.com/uuidjs/uuid/commit/9dbd1cd4177c43fcaac961a3b16fb2d044c9940a))
137
+ * remove v4 options default assignment preventing native.randomUUID from being used ([#786](https://github.com/uuidjs/uuid/issues/786)) ([afe6232](https://github.com/uuidjs/uuid/commit/afe62323c4408a824755a39d7b971a8ae06f7199))
138
+ * revert "perf: remove superfluous call to toLowerCase ([#677](https://github.com/uuidjs/uuid/issues/677))" ([#738](https://github.com/uuidjs/uuid/issues/738)) ([e267b90](https://github.com/uuidjs/uuid/commit/e267b9073df1d0ce119ee53c0487fe76acb2be37))
139
+ * seq_hi shift for byte 6 ([#775](https://github.com/uuidjs/uuid/issues/775)) ([1d532ca](https://github.com/uuidjs/uuid/commit/1d532ca374f181932a24a83fa98f71a5bd4f3e96))
140
+ * tsconfig module type ([#778](https://github.com/uuidjs/uuid/issues/778)) ([7eff835](https://github.com/uuidjs/uuid/commit/7eff835cba334ad418f57768c00d15b918a9b419))
141
+
142
+
143
+ ### Performance Improvements
144
+
145
+ * remove superfluous call to toLowerCase ([#677](https://github.com/uuidjs/uuid/issues/677)) ([e53793f](https://github.com/uuidjs/uuid/commit/e53793f5be93413cad68b05b3a339ca23e993342))
146
+
147
+
148
+ ### Miscellaneous Chores
149
+
150
+ * release 11.0.0 ([#805](https://github.com/uuidjs/uuid/issues/805)) ([b003cde](https://github.com/uuidjs/uuid/commit/b003cdeda4c6a7ab525f79b9a3d87d1395a1fb4e))
151
+
152
+ ## [11.0.0-0](https://github.com/uuidjs/uuid/compare/v9.0.0...v11.0.0-0) (2024-09-05)
153
+
154
+ ### ⚠ BREAKING CHANGES
155
+
156
+ - refactor v1 internal state and options logic (#780)
157
+ - refactor v7 internal state and options logic, fixes #764 (#779)
158
+ - Port to TypeScript, closes #762 (#763)
159
+ - update node support matrix (only support node 16-20) (#750)
160
+
161
+ ### Features
162
+
163
+ - Port to TypeScript, closes [#762](https://github.com/uuidjs/uuid/issues/762) ([#763](https://github.com/uuidjs/uuid/issues/763)) ([1e0f987](https://github.com/uuidjs/uuid/commit/1e0f9870db864ca93f7a69db0d468b5e1b7605e7))
164
+ - update node support matrix (only support node 16-20) ([#750](https://github.com/uuidjs/uuid/issues/750)) ([883b163](https://github.com/uuidjs/uuid/commit/883b163b9ab9d6655bfbd8a35e61a3c71674dfe1))
165
+
166
+ ### Bug Fixes
167
+
168
+ - missing v7 expectations in browser spec ([#751](https://github.com/uuidjs/uuid/issues/751)) ([f54a866](https://github.com/uuidjs/uuid/commit/f54a866cedb2b3b96581157c1f4ac935a0b11411))
169
+ - refactor v1 internal state and options logic ([#780](https://github.com/uuidjs/uuid/issues/780)) ([031b3d3](https://github.com/uuidjs/uuid/commit/031b3d3d738bc6694501ac0a37152b95ed500989))
170
+ - refactor v7 internal state and options logic, fixes [#764](https://github.com/uuidjs/uuid/issues/764) ([#779](https://github.com/uuidjs/uuid/issues/779)) ([9dbd1cd](https://github.com/uuidjs/uuid/commit/9dbd1cd4177c43fcaac961a3b16fb2d044c9940a))
171
+ - remove v4 options default assignment preventing native.randomUUID from being used ([#786](https://github.com/uuidjs/uuid/issues/786)) ([afe6232](https://github.com/uuidjs/uuid/commit/afe62323c4408a824755a39d7b971a8ae06f7199)), closes [#763](https://github.com/uuidjs/uuid/issues/763)
172
+ - seq_hi shift for byte 6 ([#775](https://github.com/uuidjs/uuid/issues/775)) ([1d532ca](https://github.com/uuidjs/uuid/commit/1d532ca374f181932a24a83fa98f71a5bd4f3e96))
173
+ - tsconfig module type ([#778](https://github.com/uuidjs/uuid/issues/778)) ([7eff835](https://github.com/uuidjs/uuid/commit/7eff835cba334ad418f57768c00d15b918a9b419))
174
+
5
175
  ## [10.0.0](https://github.com/uuidjs/uuid/compare/v9.0.0...v10.0.0) (2024-06-07)
6
176
 
7
177
  ### ⚠ BREAKING CHANGES
package/README.md CHANGED
@@ -7,43 +7,41 @@
7
7
 
8
8
  For the creation of [RFC9562](https://www.rfc-editor.org/rfc/rfc9562.html) (formally [RFC4122](https://www.rfc-editor.org/rfc/rfc4122.html)) UUIDs
9
9
 
10
- - **Complete** - Support for all RFC9562 (nee RFC4122) UUID versions
10
+ - **Complete** - Support for all RFC9562 UUID versions
11
11
  - **Cross-platform** - Support for ...
12
- - CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds](#cdn-builds)
12
+ - CommonJS, [ECMAScript Modules](#ecmascript-modules)
13
13
  - NodeJS 16+ ([LTS releases](https://github.com/nodejs/Release))
14
14
  - Chrome, Safari, Firefox, Edge browsers
15
- - Webpack and rollup.js module bundlers
16
- - [React Native / Expo](#react-native--expo)
17
15
  - **Secure** - Cryptographically-strong random values
18
- - **Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers
16
+ - **Compact** - No dependencies, [tree-shakable](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking)
19
17
  - **CLI** - Includes the [`uuid` command line](#command-line) utility
18
+ - **Typescript** - Types now included
20
19
 
21
20
  <!-- prettier-ignore -->
22
21
  > [!NOTE]
23
- > Upgrading from `uuid@3`? Your code is probably okay, but check out [Upgrading From `uuid@3`](#upgrading-from-uuid3) for details.
24
-
25
- <!-- prettier-ignore -->
26
- > [!NOTE]
27
- > Only interested in creating a version 4 UUID? You might be able to use [`crypto.randomUUID()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID), eliminating the need to install this library.
22
+ w> `uuid@11` is now available: See the [CHANGELOG](./CHANGELOG.md) for details. TL;DR:
23
+ > * TypeScript support is now included (remove `@types/uuid` from your dependencies)
24
+ > * Subtle changes to how the `options` arg is interpreted for `v1()`, `v6()`, and `v7()`. [See details](#options-handling-for-timestamp-uuids)
25
+ > * Binary UUIDs are now `Uint8Array`s. (May impact callers of `parse()`, `stringify()`, or that pass an `option#buf` argument to `v1()`-`v7()`.)
28
26
 
29
27
  ## Quickstart
30
28
 
31
- To create a random UUID...
32
-
33
29
  **1. Install**
34
30
 
35
31
  ```shell
36
32
  npm install uuid
37
33
  ```
38
34
 
39
- **2. Create a UUID** (ES6 module syntax)
35
+ **2. Create a UUID**
36
+
37
+ ESM-syntax (must use named exports):
40
38
 
41
39
  ```javascript
42
40
  import { v4 as uuidv4 } from 'uuid';
43
41
  uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
44
42
  ```
45
43
 
46
- ... or using CommonJS syntax:
44
+ ... CommonJS:
47
45
 
48
46
  ```javascript
49
47
  const { v4: uuidv4 } = require('uuid');
@@ -118,15 +116,12 @@ Example:
118
116
  import { parse as uuidParse } from 'uuid';
119
117
 
120
118
  // Parse a UUID
121
- const bytes = uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b');
122
-
123
- // Convert to hex strings to show byte order (for documentation purposes)
124
- [...bytes].map((v) => v.toString(16).padStart(2, '0')); // ⇨
125
- // [
126
- // '6e', 'c0', 'bd', '7f',
127
- // '11', 'c0', '43', 'da',
128
- // '97', '5e', '2a', '8a',
129
- // 'd9', 'eb', 'ae', '0b'
119
+ uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨
120
+ // Uint8Array(16) [
121
+ // 110, 192, 189, 127, 17,
122
+ // 192, 67, 218, 151, 94,
123
+ // 42, 138, 217, 235, 174,
124
+ // 11
130
125
  // ]
131
126
  ```
132
127
 
@@ -150,9 +145,24 @@ Example:
150
145
  ```javascript
151
146
  import { stringify as uuidStringify } from 'uuid';
152
147
 
153
- const uuidBytes = [
154
- 0x6e, 0xc0, 0xbd, 0x7f, 0x11, 0xc0, 0x43, 0xda, 0x97, 0x5e, 0x2a, 0x8a, 0xd9, 0xeb, 0xae, 0x0b,
155
- ];
148
+ const uuidBytes = Uint8Array.of(
149
+ 0x6e,
150
+ 0xc0,
151
+ 0xbd,
152
+ 0x7f,
153
+ 0x11,
154
+ 0xc0,
155
+ 0x43,
156
+ 0xda,
157
+ 0x97,
158
+ 0x5e,
159
+ 0x2a,
160
+ 0x8a,
161
+ 0xd9,
162
+ 0xeb,
163
+ 0xae,
164
+ 0x0b
165
+ );
156
166
 
157
167
  uuidStringify(uuidBytes); // ⇨ '6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'
158
168
  ```
@@ -164,11 +174,11 @@ Create an RFC version 1 (timestamp) UUID
164
174
  | | |
165
175
  | --- | --- |
166
176
  | [`options`] | `Object` with one or more of the following properties: |
167
- | [`options.node` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) |
168
- | [`options.clockseq`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff |
169
- | [`options.msecs`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
170
- | [`options.nsecs`] | RFC "timestamp" field (`Number` of nanoseconds to add to `msecs`, should be 0-10,000) |
171
- | [`options.random`] | `Array` of 16 random bytes (0-255) |
177
+ | [`options.node = (random)` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) |
178
+ | [`options.clockseq = (random)`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff |
179
+ | [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
180
+ | [`options.nsecs = 0`] | RFC "timestamp" field (`Number` of nanoseconds to add to `msecs`, should be 0-10,000) |
181
+ | [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above |
172
182
  | [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
173
183
  | [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
174
184
  | [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
@@ -188,7 +198,7 @@ Example:
188
198
  ```javascript
189
199
  import { v1 as uuidv1 } from 'uuid';
190
200
 
191
- uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d'
201
+ uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-9bdd-2b0d7b3dcb6d'
192
202
  ```
193
203
 
194
204
  Example using `options`:
@@ -197,7 +207,7 @@ Example using `options`:
197
207
  import { v1 as uuidv1 } from 'uuid';
198
208
 
199
209
  const options = {
200
- node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
210
+ node: Uint8Array.of(0x01, 0x23, 0x45, 0x67, 0x89, 0xab),
201
211
  clockseq: 0x1234,
202
212
  msecs: new Date('2011-11-01').getTime(),
203
213
  nsecs: 5678,
@@ -243,7 +253,7 @@ Example:
243
253
  ```javascript
244
254
  import { v4 as uuidv4 } from 'uuid';
245
255
 
246
- uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
256
+ uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
247
257
  ```
248
258
 
249
259
  Example using predefined `random` values:
@@ -252,9 +262,24 @@ Example using predefined `random` values:
252
262
  import { v4 as uuidv4 } from 'uuid';
253
263
 
254
264
  const v4options = {
255
- random: [
256
- 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36,
257
- ],
265
+ random: Uint8Array.of(
266
+ 0x10,
267
+ 0x91,
268
+ 0x56,
269
+ 0xbe,
270
+ 0xc4,
271
+ 0xfb,
272
+ 0xc1,
273
+ 0xea,
274
+ 0x71,
275
+ 0xb4,
276
+ 0xef,
277
+ 0xe1,
278
+ 0x67,
279
+ 0x1c,
280
+ 0x58,
281
+ 0x36
282
+ ),
258
283
  };
259
284
  uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836'
260
285
  ```
@@ -304,7 +329,7 @@ This method takes the same arguments as uuid.v1().
304
329
  ```javascript
305
330
  import { v6 as uuidv6 } from 'uuid';
306
331
 
307
- uuidv6(); // ⇨ '1e940672-c5ea-64c0-8bad-9b1deb4d3b7d'
332
+ uuidv6(); // ⇨ '1e940672-c5ea-64c0-9b5d-ab8dfbbd4bed'
308
333
  ```
309
334
 
310
335
  Example using `options`:
@@ -338,10 +363,10 @@ Create an RFC version 7 (random) UUID
338
363
  | | |
339
364
  | --- | --- |
340
365
  | [`options`] | `Object` with one or more of the following properties: |
341
- | [`options.msecs`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
342
- | [`options.random`] | `Array` of 16 random bytes (0-255) |
366
+ | [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
367
+ | [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above |
343
368
  | [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
344
- | [`options.seq`] | 31 bit monotonic sequence counter as `Number` between 0 - 0x7fffffff |
369
+ | [`options.seq = (random)`] | 32-bit sequence `Number` between 0 - 0xffffffff. This may be provided to help insure uniqueness for UUIDs generated within the same millisecond time interval. Default = random value. |
345
370
  | [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
346
371
  | [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
347
372
  | _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
@@ -351,7 +376,7 @@ Example:
351
376
  ```javascript
352
377
  import { v7 as uuidv7 } from 'uuid';
353
378
 
354
- uuidv7(); // ⇨ '01695553-c90c-722d-9b5d-b38dfbbd4bed'
379
+ uuidv7(); // ⇨ '01695553-c90c-705a-b56d-778dfbbd4bed'
355
380
  ```
356
381
 
357
382
  ### ~~uuid.v8()~~
@@ -447,137 +472,12 @@ Note: <namespace uuid> may be "URL" or "DNS" to use the corresponding UUIDs
447
472
  defined by RFC9562
448
473
  ```
449
474
 
450
- ## ECMAScript Modules
451
-
452
- This library comes with [ECMAScript Modules](https://www.ecma-international.org/ecma-262/6.0/#sec-modules) (ESM) support for Node.js versions that support it ([example](./examples/node-esmodules/)) as well as bundlers like [rollup.js](https://rollupjs.org/guide/en/#tree-shaking) ([example](./examples/browser-rollup/)) and [webpack](https://webpack.js.org/guides/tree-shaking/) ([example](./examples/browser-webpack/)) (targeting both, Node.js and browser environments).
453
-
454
- ```javascript
455
- import { v4 as uuidv4 } from 'uuid';
456
- uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
457
- ```
458
-
459
- To run the examples you must first create a dist build of this library in the module root:
460
-
461
- ```shell
462
- npm run build
463
- ```
464
-
465
- ## CDN Builds
475
+ ## `options` Handling for Timestamp UUIDs
466
476
 
467
- ### ECMAScript Modules
468
-
469
- To load this module directly into modern browsers that [support loading ECMAScript Modules](https://caniuse.com/#feat=es6-module) you can make use of [jspm](https://jspm.org/):
470
-
471
- ```html
472
- <script type="module">
473
- import { v4 as uuidv4 } from 'https://jspm.dev/uuid';
474
- console.log(uuidv4()); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
475
- </script>
476
- ```
477
-
478
- ### UMD
479
-
480
- As of `uuid@9` [UMD (Universal Module Definition)](https://github.com/umdjs/umd) builds are no longer shipped with this library.
481
-
482
- If you need a UMD build of this library, use a bundler like Webpack or Rollup. Alternatively, refer to the documentation of [`uuid@8.3.2`](https://github.com/uuidjs/uuid/blob/v8.3.2/README.md#umd) which was the last version that shipped UMD builds.
483
-
484
- ## Known issues
485
-
486
- ### Duplicate UUIDs (Googlebot)
487
-
488
- This module may generate duplicate UUIDs when run in clients with _deterministic_ random number generators, such as [Googlebot crawlers](https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers). This can cause problems for apps that expect client-generated UUIDs to always be unique. Developers should be prepared for this and have a strategy for dealing with possible collisions, such as:
489
-
490
- - Check for duplicate UUIDs, fail gracefully
491
- - Disable write operations for Googlebot clients
492
-
493
- ### "getRandomValues() not supported"
494
-
495
- This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill:
496
-
497
- ### React Native / Expo
498
-
499
- 1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme)
500
- 1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point:
501
-
502
- ```javascript
503
- import 'react-native-get-random-values';
504
- import { v4 as uuidv4 } from 'uuid';
505
- ```
506
-
507
- <!-- prettier-ignore -->
508
- > [!NOTE]
509
- > If you are using Expo, you must be using at least `react-native-get-random-values@1.5.0` and `expo@39.0.0`.
510
-
511
- ### Web Workers / Service Workers (Edge <= 18)
512
-
513
- [In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please).
514
-
515
- ### IE 11 (Internet Explorer)
516
-
517
- Support for IE11 and other legacy browsers has been dropped as of `uuid@9`. If you need to support legacy browsers, you can always transpile the uuid module source yourself (e.g. using [Babel](https://babeljs.io/)).
518
-
519
- ## Upgrading From `uuid@7`
520
-
521
- ### Only Named Exports Supported When Using with Node.js ESM
522
-
523
- `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.
524
-
525
- Instead of doing:
526
-
527
- ```javascript
528
- import uuid from 'uuid';
529
- uuid.v4();
530
- ```
531
-
532
- you will now have to use the named exports:
533
-
534
- ```javascript
535
- import { v4 as uuidv4 } from 'uuid';
536
- uuidv4();
537
- ```
538
-
539
- ### Deep Requires No Longer Supported
540
-
541
- Deep requires like `require('uuid/v4')` [which have been deprecated in `uuid@7`](#deep-requires-now-deprecated) are no longer supported.
542
-
543
- ## Upgrading From `uuid@3`
544
-
545
- "_Wait... what happened to `uuid@4` thru `uuid@6`?!?_"
546
-
547
- 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.
548
-
549
- ### Deep Requires Now Deprecated
550
-
551
- `uuid@3` encouraged the use of deep requires to minimize the bundle size of browser builds:
552
-
553
- ```javascript
554
- const uuidv4 = require('uuid/v4'); // <== NOW DEPRECATED!
555
- uuidv4();
556
- ```
557
-
558
- 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:
559
-
560
- ```javascript
561
- import { v4 as uuidv4 } from 'uuid';
562
- uuidv4();
563
- ```
564
-
565
- ... or for CommonJS:
566
-
567
- ```javascript
568
- const { v4: uuidv4 } = require('uuid');
569
- uuidv4();
570
- ```
571
-
572
- ### Default Export Removed
573
-
574
- `uuid@3` was exporting the Version 4 UUID method as a default export:
575
-
576
- ```javascript
577
- const uuid = require('uuid'); // <== REMOVED!
578
- ```
477
+ Prior to `uuid@11`, it was possible for `options` state to interfere with the internal state used to insure uniqueness of timestamp-based UUIDs (the `v1()`, `v6()`, and `v7()` methods). Starting with `uuid@11`, this issue has been addressed by using the presence of the `options` argument as a flag to select between two possible behaviors:
579
478
 
580
- This usage pattern was already discouraged in `uuid@3` and has been removed in `uuid@7`.
479
+ - Without `options`: Internal state is utilized to improve UUID uniqueness.
480
+ - With `options`: Internal state is **NOT** used and, instead, appropriate defaults are applied as needed.
581
481
 
582
482
  ---
583
483
 
@@ -0,0 +1,21 @@
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
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiX3R5cGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL190eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
@@ -0,0 +1,14 @@
1
+ export { default as MAX } from './max.js';
2
+ export { default as NIL } from './nil.js';
3
+ export { default as parse } from './parse.js';
4
+ export { default as stringify } from './stringify.js';
5
+ export { default as v1 } from './v1.js';
6
+ export { default as v1ToV6 } from './v1ToV6.js';
7
+ export { default as v3 } from './v3.js';
8
+ export { default as v4 } from './v4.js';
9
+ export { default as v5 } from './v5.js';
10
+ export { default as v6 } from './v6.js';
11
+ export { default as v6ToV1 } from './v6ToV1.js';
12
+ export { default as v7 } from './v7.js';
13
+ export { default as validate } from './validate.js';
14
+ export { default as version } from './version.js';
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.version = exports.validate = exports.v7 = exports.v6ToV1 = exports.v6 = exports.v5 = exports.v4 = exports.v3 = exports.v1ToV6 = exports.v1 = exports.stringify = exports.parse = exports.NIL = exports.MAX = void 0;
4
+ var max_js_1 = require("./max.js");
5
+ Object.defineProperty(exports, "MAX", { enumerable: true, get: function () { return max_js_1.default; } });
6
+ var nil_js_1 = require("./nil.js");
7
+ Object.defineProperty(exports, "NIL", { enumerable: true, get: function () { return nil_js_1.default; } });
8
+ var parse_js_1 = require("./parse.js");
9
+ Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parse_js_1.default; } });
10
+ var stringify_js_1 = require("./stringify.js");
11
+ Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return stringify_js_1.default; } });
12
+ var v1_js_1 = require("./v1.js");
13
+ Object.defineProperty(exports, "v1", { enumerable: true, get: function () { return v1_js_1.default; } });
14
+ var v1ToV6_js_1 = require("./v1ToV6.js");
15
+ Object.defineProperty(exports, "v1ToV6", { enumerable: true, get: function () { return v1ToV6_js_1.default; } });
16
+ var v3_js_1 = require("./v3.js");
17
+ Object.defineProperty(exports, "v3", { enumerable: true, get: function () { return v3_js_1.default; } });
18
+ var v4_js_1 = require("./v4.js");
19
+ Object.defineProperty(exports, "v4", { enumerable: true, get: function () { return v4_js_1.default; } });
20
+ var v5_js_1 = require("./v5.js");
21
+ Object.defineProperty(exports, "v5", { enumerable: true, get: function () { return v5_js_1.default; } });
22
+ var v6_js_1 = require("./v6.js");
23
+ Object.defineProperty(exports, "v6", { enumerable: true, get: function () { return v6_js_1.default; } });
24
+ var v6ToV1_js_1 = require("./v6ToV1.js");
25
+ Object.defineProperty(exports, "v6ToV1", { enumerable: true, get: function () { return v6ToV1_js_1.default; } });
26
+ var v7_js_1 = require("./v7.js");
27
+ Object.defineProperty(exports, "v7", { enumerable: true, get: function () { return v7_js_1.default; } });
28
+ var validate_js_1 = require("./validate.js");
29
+ Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_js_1.default; } });
30
+ var version_js_1 = require("./version.js");
31
+ Object.defineProperty(exports, "version", { enumerable: true, get: function () { return version_js_1.default; } });
32
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsbUNBQTBDO0FBQWpDLDZGQUFBLE9BQU8sT0FBTztBQUN2QixtQ0FBMEM7QUFBakMsNkZBQUEsT0FBTyxPQUFPO0FBQ3ZCLHVDQUE4QztBQUFyQyxpR0FBQSxPQUFPLE9BQVM7QUFDekIsK0NBQXNEO0FBQTdDLHlHQUFBLE9BQU8sT0FBYTtBQUM3QixpQ0FBd0M7QUFBL0IsMkZBQUEsT0FBTyxPQUFNO0FBQ3RCLHlDQUFnRDtBQUF2QyxtR0FBQSxPQUFPLE9BQVU7QUFDMUIsaUNBQXdDO0FBQS9CLDJGQUFBLE9BQU8sT0FBTTtBQUN0QixpQ0FBd0M7QUFBL0IsMkZBQUEsT0FBTyxPQUFNO0FBQ3RCLGlDQUF3QztBQUEvQiwyRkFBQSxPQUFPLE9BQU07QUFDdEIsaUNBQXdDO0FBQS9CLDJGQUFBLE9BQU8sT0FBTTtBQUN0Qix5Q0FBZ0Q7QUFBdkMsbUdBQUEsT0FBTyxPQUFVO0FBQzFCLGlDQUF3QztBQUEvQiwyRkFBQSxPQUFPLE9BQU07QUFDdEIsNkNBQW9EO0FBQTNDLHVHQUFBLE9BQU8sT0FBWTtBQUM1QiwyQ0FBa0Q7QUFBekMscUdBQUEsT0FBTyxPQUFXIn0=
@@ -0,0 +1,2 @@
1
+ declare const _default: "ffffffff-ffff-ffff-ffff-ffffffffffff";
2
+ export default _default;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = 'ffffffff-ffff-ffff-ffff-ffffffffffff';
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWF4LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL21heC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLGtCQUFlLHNDQUFzQyxDQUFDIn0=
@@ -0,0 +1,2 @@
1
+ declare function md5(bytes: Uint8Array): Buffer;
2
+ export default md5;