0.2.1 • Published 1 month ago

@uniiem/uuid v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

@uniiem/uuid

GitHub Actions Workflow Status NPM Downloads NPM Version (with dist tag) npm bundle size GitHub License

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;
0.2.1

1 month ago

0.2.0

1 month ago

0.1.9

1 month ago