You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* exclude tests from published package ([#840](https://github.com/uuidjs/uuid/issues/840)) ([f992ff4](https://github.com/uuidjs/uuid/commit/f992ff4780937089b0134195fa22e76e2e1cb3a7))
10
+
* Test for invalid byte array sizes and ranges in `v1()`, `v4()`, and `v7()` ([#845](https://github.com/uuidjs/uuid/issues/845)) ([e0ee900](https://github.com/uuidjs/uuid/commit/e0ee90051ebd13475bbcff4d371330aa4f9bd1dd))
@@ -367,7 +366,7 @@ Create an RFC version 7 (random) UUID
367
366
|[`options.msecs = (current time)`]| RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
368
367
|[`options.random = (random)`]|`Array` of 16 random bytes (0-255) used to generate other fields, above |
369
368
|[`options.rng`]| Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
370
-
|[`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. |
369
+
|[`options.seq = (random)`]| 32-bit sequence `Number` between 0 - 0xffffffff. This may be provided to help ensure uniqueness for UUIDs generated within the same millisecond time interval. Default = random value. |
371
370
|[`buffer`]|`Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset`|
372
371
|[`offset` = 0]|`Number` Index to start writing UUID bytes in `buffer`|
373
372
|_returns_| UUID `String` if no `buffer` is specified, otherwise returns `buffer`|
@@ -475,14 +474,28 @@ defined by RFC9562
475
474
476
475
## `options` Handling for Timestamp UUIDs
477
476
478
-
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:
477
+
Prior to `uuid@11`, it was possible for `options` state to interfere with the internal state used to ensure 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:
479
478
480
479
- Without `options`: Internal state is utilized to improve UUID uniqueness.
481
480
- With `options`: Internal state is **NOT** used and, instead, appropriate defaults are applied as needed.
482
481
482
+
## Support
483
+
484
+
**Browsers**: `uuid`[builds are tested](/uuidjs/uuid/blob/main/wdio.conf.js) against the latest version of desktop Chrome, Safari, Firefox, and Edge. Mobile versions of these same browsers are expected to work but aren't currently tested.
485
+
486
+
**Node**: `uuid`[builds are tested](https://github.com/uuidjs/uuid/blob/main/.github/workflows/ci.yml#L26-L27) against node ([LTS releases](https://github.com/nodejs/Release)), plus one prior. E.g. `node@18` is in maintainence mode, and `node@22` is the current LTS release. So `uuid` supports `node@16`-`node@22`.
487
+
488
+
**Typescript**: TS versions released within the past two years are supported. [source](https://github.com/microsoft/TypeScript/issues/49088#issuecomment-2468723715)
489
+
483
490
## Known issues
484
491
485
-
### React Native / Expo
492
+
<!-- This header is referenced as an anchor in src/rng-browser.ts -->
493
+
494
+
### "getRandomValues() not supported"
495
+
496
+
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:
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:
@@ -494,4 +507,4 @@ import { v4 as uuidv4 } from 'uuid';
494
507
495
508
---
496
509
497
-
Markdown generated from [README_js.md](README_js.md) by <ahref="https://github.com/broofa/runmd"><imageheight="12px"src="https://camo.githubusercontent.com/5c7c603cd1e6a43370b0a5063d457e0dabb74cf317adc7baba183acb686ee8d0/687474703a2f2f692e696d6775722e636f6d2f634a4b6f3662552e706e67" /></a>
510
+
Markdown generated from [README_js.md](README_js.md) by <ahref="https://github.com/broofa/runmd"><imageheight="13"src="https://camo.githubusercontent.com/5c7c603cd1e6a43370b0a5063d457e0dabb74cf317adc7baba183acb686ee8d0/687474703a2f2f692e696d6775722e636f6d2f634a4b6f3662552e706e67" /></a>
-**Secure** - Cryptographically-strong random values
31
31
-**Compact** - No dependencies, [tree-shakable](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking)
@@ -375,7 +375,7 @@ Create an RFC version 7 (random) UUID
375
375
|[`options.msecs = (current time)`]| RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
376
376
|[`options.random = (random)`]|`Array` of 16 random bytes (0-255) used to generate other fields, above |
377
377
|[`options.rng`]| Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
378
-
|[`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. |
378
+
|[`options.seq = (random)`]| 32-bit sequence `Number` between 0 - 0xffffffff. This may be provided to help ensure uniqueness for UUIDs generated within the same millisecond time interval. Default = random value. |
379
379
|[`buffer`]|`Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset`|
380
380
|[`offset` = 0]|`Number` Index to start writing UUID bytes in `buffer`|
381
381
|_returns_| UUID `String` if no `buffer` is specified, otherwise returns `buffer`|
@@ -483,14 +483,28 @@ defined by RFC9562
483
483
484
484
## `options` Handling for Timestamp UUIDs
485
485
486
-
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:
486
+
Prior to `uuid@11`, it was possible for `options` state to interfere with the internal state used to ensure 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:
487
487
488
488
- Without `options`: Internal state is utilized to improve UUID uniqueness.
489
489
- With `options`: Internal state is **NOT** used and, instead, appropriate defaults are applied as needed.
490
490
491
+
## Support
492
+
493
+
**Browsers**: `uuid`[builds are tested](/uuidjs/uuid/blob/main/wdio.conf.js) against the latest version of desktop Chrome, Safari, Firefox, and Edge. Mobile versions of these same browsers are expected to work but aren't currently tested.
494
+
495
+
**Node**: `uuid`[builds are tested](https://github.com/uuidjs/uuid/blob/main/.github/workflows/ci.yml#L26-L27) against node ([LTS releases](https://github.com/nodejs/Release)), plus one prior. E.g. `node@18` is in maintainence mode, and `node@22` is the current LTS release. So `uuid` supports `node@16`-`node@22`.
496
+
497
+
**Typescript**: TS versions released within the past two years are supported. [source](https://github.com/microsoft/TypeScript/issues/49088#issuecomment-2468723715)
498
+
491
499
## Known issues
492
500
493
-
### React Native / Expo
501
+
<!-- This header is referenced as an anchor in src/rng-browser.ts -->
502
+
503
+
### "getRandomValues() not supported"
504
+
505
+
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:
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:
0 commit comments