Skip to content

Type Alias: UUIDVersion4Options ​

UUIDVersion4Options = object

The options of a version 4 (random) UUID. Without options, the UUID comes from crypto.randomUUID().

Properties ​

random? ​

optional random?: Uint8Array

16 random bytes (or more, fewer make the generation throw an Error) making the UUID, with its version and variant bits set (in a copy: the array is not changed); it takes precedence over rng.

Default ​

ts
bytes from the cryptographic random generator of Node.js

rng? ​

optional rng?: () => Uint8Array

A function returning 16 random bytes (or more), called when random is not given.

Returns ​

Uint8Array

Default ​

ts
the cryptographic random generator of Node.js

Released under the MIT License.