@uniiem/uuid
v0.2.1
Published
A simple and fast UUID generator for JavaScript.
Downloads
11
Readme
@uniiem/uuid
Fast UUID Generator for TypeScript/JavaScript
Usage
npm i @uniiem/uuid
import { NIL, uuidv1, uuidv4 } fromo '@uniiem/uuid';
console.log(NIL); // 00000000-0000-0000-0000-000000000000
console.log(uuidv1()); // fbc0f1a0-ef67-11ee-9e13-396902bb4dbf
console.log(uuidv4()); // 301d3087-1961-41d6-992d-66fe1b5fee49
API
NIL
/**
* Represents a nil UUID.
*/
const NIL: string;
uuidv1
/**
* Generate a version 1 UUID.
*/
const uuidv1: (options?: UUIDv1Options, buf?: Uint8Array, offset?: number) => UUID;
interface UUIDv1Options {
node_id?: Uint8Array;
clock_sequence?: number;
millsecs?: number;
nanosecs?: number;
seed?: Uint8Array;
}
uuidv4
/**
* Generate a version 4 UUID.
*/
const uuidv4: (buf?: Uint8Array, offset?: number) => UUID;