---
title: "@std/uuid"
description: "Generators and validators for UUIDs"
jsr: jsr:@std/uuid
pkg: uuid
version: 1.1.0
generated: true
stability: stable
---
<!-- Autogenerated from JSR docs. Do not edit directly. -->

## Overview

<p>Generators and validators for
<a href="https://www.rfc-editor.org/rfc/rfc9562.html" rel="nofollow">RFC 9562</a> UUIDs for
versions v1, v3, v4, v5, v6 and v7.</p>
<p>Use the built-in
<a href="https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID" rel="nofollow"><code>crypto.randomUUID()</code></a>
function instead of this package, if you only need to generate v4 UUIDs.</p>
<p>Based on <a href="https://www.npmjs.com/package/uuid" rel="nofollow"><code>npm:uuid</code></a>.</p>

```js
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

```sh
deno add jsr:@std/uuid
```

<a href="https://jsr.io/@std/uuid/doc" class="docs-cta jsr-cta">See all symbols in @std/uuid on
<svg class="inline ml-1" viewBox="0 0 13 7" aria-hidden="true" height="20"><path d="M0,2h2v-2h7v1h4v4h-2v2h-7v-1h-4" fill="#083344"></path><g fill="#f7df1e"><path d="M1,3h1v1h1v-3h1v4h-3"></path><path d="M5,1h3v1h-2v1h2v3h-3v-1h2v-1h-2"></path><path d="M9,2h3v2h-1v-1h-1v3h-1"></path></g></svg></a>

<!-- custom:start -->
<!-- Add persistent custom content below. This section is preserved across generations. -->

<!-- custom:end -->
