Skip to main content

@std/uuid@1.0.9
Built and signed on GitHub Actions

Generators and validators for UUIDs

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
6 months ago (1.0.9)

Generators and validators for RFC 9562 UUIDs for versions v1, v3, v4, v5, v6 and v7.

Use the built-in crypto.randomUUID() function instead of this package, if you only need to generate v4 UUIDs.

Based on npm:uuid.

import { v5, NAMESPACE_DNS, NIL_UUID } from "@std/uuid";
import { assert, assertFalse } from "@std/assert";

const data = new TextEncoder().encode("deno.land");
const uuid = await v5.generate(NAMESPACE_DNS, data);

assert(v5.validate(uuid));
assertFalse(v5.validate(NIL_UUID));
Built and signed on
GitHub Actions

Add Package

deno add jsr:@std/uuid

Import symbol

import * as uuid from "@std/uuid";
or

Import directly with a jsr specifier

import * as uuid from "jsr:@std/uuid";

Add Package

pnpm i jsr:@std/uuid
or (using pnpm 10.8 or older)
pnpm dlx jsr add @std/uuid

Import symbol

import * as uuid from "@std/uuid";

Add Package

yarn add jsr:@std/uuid
or (using Yarn 4.8 or older)
yarn dlx jsr add @std/uuid

Import symbol

import * as uuid from "@std/uuid";

Add Package

vlt install jsr:@std/uuid

Import symbol

import * as uuid from "@std/uuid";

Add Package

npx jsr add @std/uuid

Import symbol

import * as uuid from "@std/uuid";

Add Package

bunx jsr add @std/uuid

Import symbol

import * as uuid from "@std/uuid";