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

std/uuid/v3.ts>validate

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function validate
import { validate } from "https://deno.land/std@0.196.0/uuid/v3.ts";

Validate that the passed UUID is an RFC4122 v3 UUID.

Examples

Example 1

import { generate as generateV3, validate } from "https://deno.land/std@0.196.0/uuid/v3.ts";

validate(await generateV3("6ba7b811-9dad-11d1-80b4-00c04fd430c8", new Uint8Array())); // true
validate(crypto.randomUUID()); // false
validate("this-is-not-a-uuid"); // false

Parameters

id: string

Returns

boolean