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

std/uuid/mod.ts

The Deno Standard Library
Latest
The Standard Library has been moved to JSR. See the blog post for details.
import * as mod from "https://deno.land/std@0.224.0/uuid/mod.ts";

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

Use crypto.randomUUID for v4 generating v4 UUIDs.

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

Support for RFC4122 version 1, 3, 4, and 5 UUIDs

This module is browser compatible.

Variables

Name string is a fully-qualified domain name.

Name string is an ISO OID.

Name string is a URL.

Name string is an X.500 DN (in DER or a text output format).

The nil UUID is special form of UUID that is specified to have all 128 bits set to zero.

Functions

Check if the passed UUID is the nil UUID.

Generates a RFC4122 v1 UUID (time-based).

Validates the UUID v1.

Generate a RFC4122 v3 UUID (MD5 namespace).

Validate that the passed UUID is an RFC4122 v3 UUID.

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 in generate.