Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/hex/src/lib/stdx/uuid.ts

An ecosystem delivering practices, philosophy and portability. Powered By Deno and JavaScript.
Latest
import * as hex from "https://deno.land/x/hex@0.6.5/src/lib/stdx/uuid.ts";

Generators and validators for UUIDs for versions v1, v4 and v5.

Consider using the web platform crypto.randomUUID for v4 UUIDs instead.

Based on https://github.com/kelektiv/node-uuid -> https://www.ietf.org/rfc/rfc4122.txt

Support for RFC4122 version 1, 4, and 5 UUIDs

This module is browser compatible.

Functions

Check if the passed UUID is the nil UUID.

Generates a RFC4122 v1 UUID (time-based).

Validates the UUID v1.

Validate that the passed UUID is an RFC4122 v4 UUID.

Generate a RFC4122 v5 UUID (SHA-1 namespace).

Validate that the passed UUID is an RFC4122 v5 UUID.

Test a string to see if it is a valid UUID.

Detect RFC version of a UUID.

Interfaces

The options used for generating a v1 UUID.