Skip to main content
On this page

@std/uuid

Overview Jump to heading

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

Add to your project Jump to heading

deno add jsr:@std/uuid

See all symbols in @std/uuid on

Did you find what you needed?

Privacy policy