UUID (version 1 and 4) generation library. Also offers conversion methods between string representation and binary (array of numbers or Uint8Array) representation. Comes in UMD version for good compatibility and ESM version ready for treeshaking.
This module is a part of the visjs project.
https://visjs.github.io/vis-uuid/
Clone the project:
git clone https://github.com/visjs/vis-uuid.git
Install dependencies:
npm i
Build the project (builds types, code and docs):
npm run build
npm run build:code
npm run build:docs
npm run build:types
npm run clean
npm run lint
npm run fix
npm run build
npm run type-check
This project is dual licensed under
The Apache 2.0 License http://www.apache.org/licenses/LICENSE-2.0
and
The MIT License http://opensource.org/licenses/MIT
Vis UUID may be distributed under either license.
API as used before ES2015 modules and TypeScript.
Parse a string UUID representation into it's component bytes.
String UUID.
Buffer to be filled with the bytes.
Offset from the start of the buffer where the UUID bytes will be saved.
An array (or Uint8Array if supplied) of bytes.
Represent binary UUID into it's string representation.
Buffer containing UUID bytes.
Offset from the start of the buffer where the UUID is saved (not needed if the buffer starts with the UUID).
String representation of the UUID.
Generate UUIDv1
Options to be used instead of default values.
UUIDv1
Generate UUIDv1
Options to be used instead of default values.
If present the buffer will be filled with the generated UUID.
Offset of the UUID from the start of the buffer.
UUIDv1
Generate UUIDv4
Options to be used instead of default generated values. String 'binary' is a shorthand for uuid4({}, new Array(16)).
UUIDv4
Generate UUIDv4
Options to be used instead of default generated values. String 'binary' is a shorthand for uuid4({}, new Array(16)).
UUIDv4
Generate UUIDv4
Options to be used instead of default generated values. String 'binary' is a shorthand for uuid4({}, new Array(16)).
If present the buffer will be filled with the generated UUID.
Offset of the UUID from the start of the buffer.
UUIDv4
Generated using TypeDoc
Uint8Array or an array of numbers. Used to store binary UUIDs or to supply random data to generate them.