Update checked-in dependencies
This commit is contained in:
parent
ca3043e8ef
commit
9ee83fa7ef
183 changed files with 2391 additions and 1212 deletions
150
node_modules/uuid/README.md
generated
vendored
150
node_modules/uuid/README.md
generated
vendored
|
|
@ -5,12 +5,12 @@
|
|||
|
||||
# uuid [](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [](https://github.com/uuidjs/uuid/actions?query=workflow%3ABrowser)
|
||||
|
||||
For the creation of [RFC4122](https://www.ietf.org/rfc/rfc4122.txt) UUIDs
|
||||
For the creation of [RFC9562](https://www.rfc-editor.org/rfc/rfc9562.html) (formally [RFC4122](https://www.rfc-editor.org/rfc/rfc4122.html)) UUIDs
|
||||
|
||||
- **Complete** - Support for RFC4122 version 1, 3, 4, and 5 UUIDs
|
||||
- **Complete** - Support for all RFC9562 (nee RFC4122) UUID versions
|
||||
- **Cross-platform** - Support for ...
|
||||
- CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds](#cdn-builds)
|
||||
- NodeJS 12+ ([LTS releases](https://github.com/nodejs/Release))
|
||||
- NodeJS 16+ ([LTS releases](https://github.com/nodejs/Release))
|
||||
- Chrome, Safari, Firefox, Edge browsers
|
||||
- Webpack and rollup.js module bundlers
|
||||
- [React Native / Expo](#react-native--expo)
|
||||
|
|
@ -18,9 +18,13 @@ For the creation of [RFC4122](https://www.ietf.org/rfc/rfc4122.txt) UUIDs
|
|||
- **Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers
|
||||
- **CLI** - Includes the [`uuid` command line](#command-line) utility
|
||||
|
||||
> **Note** Upgrading from `uuid@3`? Your code is probably okay, but check out [Upgrading From `uuid@3`](#upgrading-from-uuid3) for details.
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
> Upgrading from `uuid@3`? Your code is probably okay, but check out [Upgrading From `uuid@3`](#upgrading-from-uuid3) for details.
|
||||
|
||||
> **Note** 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.
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
> 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.
|
||||
|
||||
## Quickstart
|
||||
|
||||
|
|
@ -53,12 +57,18 @@ For timestamp UUIDs, namespace UUIDs, and other options read on ...
|
|||
| | | |
|
||||
| --- | --- | --- |
|
||||
| [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) | New in `uuid@8.3` |
|
||||
| [`uuid.MAX`](#uuidmax) | The max UUID string (all ones) | New in `uuid@9.1` |
|
||||
| [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes | New in `uuid@8.3` |
|
||||
| [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string | New in `uuid@8.3` |
|
||||
| [`uuid.v1()`](#uuidv1options-buffer-offset) | Create a version 1 (timestamp) UUID | |
|
||||
| [`uuid.v1ToV6()`](#uuidv1tov6uuid) | Create a version 6 UUID from a version 1 UUID | New in `uuid@10` |
|
||||
| [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) | Create a version 3 (namespace w/ MD5) UUID | |
|
||||
| [`uuid.v4()`](#uuidv4options-buffer-offset) | Create a version 4 (random) UUID | |
|
||||
| [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) | Create a version 5 (namespace w/ SHA-1) UUID | |
|
||||
| [`uuid.v6()`](#uuidv6options-buffer-offset) | Create a version 6 (timestamp, reordered) UUID | New in `uuid@10` |
|
||||
| [`uuid.v6ToV1()`](#uuidv6tov1uuid) | Create a version 1 UUID from a version 6 UUID | New in `uuid@10` |
|
||||
| [`uuid.v7()`](#uuidv7options-buffer-offset) | Create a version 7 (Unix Epoch time-based) UUID | New in `uuid@10` |
|
||||
| ~~[`uuid.v8()`](#uuidv8)~~ | "Intentionally left blank" | |
|
||||
| [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID | New in `uuid@8.3` |
|
||||
| [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID | New in `uuid@8.3` |
|
||||
|
||||
|
|
@ -76,6 +86,18 @@ import { NIL as NIL_UUID } from 'uuid';
|
|||
NIL_UUID; // ⇨ '00000000-0000-0000-0000-000000000000'
|
||||
```
|
||||
|
||||
### uuid.MAX
|
||||
|
||||
The max UUID string (all ones).
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { MAX as MAX_UUID } from 'uuid';
|
||||
|
||||
MAX_UUID; // ⇨ 'ffffffff-ffff-ffff-ffff-ffffffffffff'
|
||||
```
|
||||
|
||||
### uuid.parse(str)
|
||||
|
||||
Convert UUID string to array of bytes
|
||||
|
|
@ -86,7 +108,9 @@ Convert UUID string to array of bytes
|
|||
| _returns_ | `Uint8Array[16]` |
|
||||
| _throws_ | `TypeError` if `str` is not a valid UUID |
|
||||
|
||||
Note: Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below.
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
> Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below.
|
||||
|
||||
Example:
|
||||
|
||||
|
|
@ -97,7 +121,7 @@ import { parse as uuidParse } from 'uuid';
|
|||
const bytes = uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b');
|
||||
|
||||
// Convert to hex strings to show byte order (for documentation purposes)
|
||||
[...bytes].map((v) => v.toString(16).padStart(2, '0')); // ⇨
|
||||
[...bytes].map((v) => v.toString(16).padStart(2, '0')); // ⇨
|
||||
// [
|
||||
// '6e', 'c0', 'bd', '7f',
|
||||
// '11', 'c0', '43', 'da',
|
||||
|
|
@ -117,7 +141,9 @@ Convert array of bytes to UUID string
|
|||
| _returns_ | `String` |
|
||||
| _throws_ | `TypeError` if a valid UUID string cannot be generated |
|
||||
|
||||
Note: Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below.
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
> Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below.
|
||||
|
||||
Example:
|
||||
|
||||
|
|
@ -149,9 +175,13 @@ Create an RFC version 1 (timestamp) UUID
|
|||
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
|
||||
| _throws_ | `Error` if more than 10M UUIDs/sec are requested |
|
||||
|
||||
Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process.
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
> The default [node id](https://datatracker.ietf.org/doc/html/rfc9562#section-5.1) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process.
|
||||
|
||||
Note: `options.random` and `options.rng` are only meaningful on the very first call to `v1()`, where they may be passed to initialize the internal `node` and `clockseq` fields.
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
> `options.random` and `options.rng` are only meaningful on the very first call to `v1()`, where they may be passed to initialize the internal `node` and `clockseq` fields.
|
||||
|
||||
Example:
|
||||
|
||||
|
|
@ -166,13 +196,23 @@ Example using `options`:
|
|||
```javascript
|
||||
import { v1 as uuidv1 } from 'uuid';
|
||||
|
||||
const v1options = {
|
||||
const options = {
|
||||
node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
|
||||
clockseq: 0x1234,
|
||||
msecs: new Date('2011-11-01').getTime(),
|
||||
nsecs: 5678,
|
||||
};
|
||||
uuidv1(v1options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab'
|
||||
uuidv1(options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab'
|
||||
```
|
||||
|
||||
### uuid.v1ToV6(uuid)
|
||||
|
||||
Convert a UUID from version 1 to version 6
|
||||
|
||||
```javascript
|
||||
import { v1ToV6 } from 'uuid';
|
||||
|
||||
v1ToV6('92f62d9e-22c4-11ef-97e9-325096b39f47'); // ⇨ '1ef22c49-2f62-6d9e-97e9-325096b39f47'
|
||||
```
|
||||
|
||||
### uuid.v3(name, namespace[, buffer[, offset]])
|
||||
|
|
@ -181,7 +221,9 @@ Create an RFC version 3 (namespace w/ MD5) UUID
|
|||
|
||||
API is identical to `v5()`, but uses "v3" instead.
|
||||
|
||||
⚠️ Note: Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_."
|
||||
<!-- prettier-ignore -->
|
||||
> [!IMPORTANT]
|
||||
> Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_."
|
||||
|
||||
### uuid.v4([options[, buffer[, offset]]])
|
||||
|
||||
|
|
@ -229,7 +271,9 @@ Create an RFC version 5 (namespace w/ SHA-1) UUID
|
|||
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
|
||||
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
|
||||
|
||||
Note: The RFC `DNS` and `URL` namespaces are available as `v5.DNS` and `v5.URL`.
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
> The RFC `DNS` and `URL` namespaces are available as `v5.DNS` and `v5.URL`.
|
||||
|
||||
Example with custom namespace:
|
||||
|
||||
|
|
@ -251,6 +295,73 @@ import { v5 as uuidv5 } from 'uuid';
|
|||
uuidv5('https://www.w3.org/', uuidv5.URL); // ⇨ 'c106a26a-21bb-5538-8bf2-57095d1976c1'
|
||||
```
|
||||
|
||||
### uuid.v6([options[, buffer[, offset]]])
|
||||
|
||||
Create an RFC version 6 (timestamp, reordered) UUID
|
||||
|
||||
This method takes the same arguments as uuid.v1().
|
||||
|
||||
```javascript
|
||||
import { v6 as uuidv6 } from 'uuid';
|
||||
|
||||
uuidv6(); // ⇨ '1e940672-c5ea-64c0-8bad-9b1deb4d3b7d'
|
||||
```
|
||||
|
||||
Example using `options`:
|
||||
|
||||
```javascript
|
||||
import { v6 as uuidv6 } from 'uuid';
|
||||
|
||||
const options = {
|
||||
node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
|
||||
clockseq: 0x1234,
|
||||
msecs: new Date('2011-11-01').getTime(),
|
||||
nsecs: 5678,
|
||||
};
|
||||
uuidv6(options); // ⇨ '1e1041c7-10b9-662e-9234-0123456789ab'
|
||||
```
|
||||
|
||||
### uuid.v6ToV1(uuid)
|
||||
|
||||
Convert a UUID from version 6 to version 1
|
||||
|
||||
```javascript
|
||||
import { v6ToV1 } from 'uuid';
|
||||
|
||||
v6ToV1('1ef22c49-2f62-6d9e-97e9-325096b39f47'); // ⇨ '92f62d9e-22c4-11ef-97e9-325096b39f47'
|
||||
```
|
||||
|
||||
### uuid.v7([options[, buffer[, offset]]])
|
||||
|
||||
Create an RFC version 7 (random) UUID
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| [`options`] | `Object` with one or more of the following properties: |
|
||||
| [`options.msecs`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
|
||||
| [`options.random`] | `Array` of 16 random bytes (0-255) |
|
||||
| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
|
||||
| [`options.seq`] | 31 bit monotonic sequence counter as `Number` between 0 - 0x7fffffff |
|
||||
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
|
||||
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
|
||||
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { v7 as uuidv7 } from 'uuid';
|
||||
|
||||
uuidv7(); // ⇨ '01695553-c90c-722d-9b5d-b38dfbbd4bed'
|
||||
```
|
||||
|
||||
### ~~uuid.v8()~~
|
||||
|
||||
**_"Intentionally left blank"_**
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
> Version 8 (experimental) UUIDs are "[for experimental or vendor-specific use cases](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-8)". The RFC does not define a creation algorithm for them, which is why this package does not offer a `v8()` method. The `validate()` and `version()` methods do work with such UUIDs, however.
|
||||
|
||||
### uuid.validate(str)
|
||||
|
||||
Test a string to see if it is a valid UUID
|
||||
|
|
@ -305,6 +416,10 @@ uuidVersion('45637ec4-c85f-11ea-87d0-0242ac130003'); // ⇨ 1
|
|||
uuidVersion('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ 4
|
||||
```
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
> This method returns `0` for the `NIL` UUID, and `15` for the `MAX` UUID.
|
||||
|
||||
## Command Line
|
||||
|
||||
UUIDs can be generated from the command line using `uuid`.
|
||||
|
|
@ -325,10 +440,11 @@ Usage:
|
|||
uuid v3 <name> <namespace uuid>
|
||||
uuid v4
|
||||
uuid v5 <name> <namespace uuid>
|
||||
uuid v7
|
||||
uuid --help
|
||||
|
||||
Note: <namespace uuid> may be "URL" or "DNS" to use the corresponding UUIDs
|
||||
defined by RFC4122
|
||||
defined by RFC9562
|
||||
```
|
||||
|
||||
## ECMAScript Modules
|
||||
|
|
@ -388,7 +504,9 @@ import 'react-native-get-random-values';
|
|||
import { v4 as uuidv4 } from 'uuid';
|
||||
```
|
||||
|
||||
Note: If you are using Expo, you must be using at least `react-native-get-random-values@1.5.0` and `expo@39.0.0`.
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
> If you are using Expo, you must be using at least `react-native-get-random-values@1.5.0` and `expo@39.0.0`.
|
||||
|
||||
### Web Workers / Service Workers (Edge <= 18)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue