Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

std/uuid/mod.ts>v3.validate

The Deno Standard Library
Go to Latest
function v3.validate
import { v3 } from "https://deno.land/std@0.222.1/uuid/mod.ts";
const { validate } = v3;

Validate that the passed UUID is an RFC4122 v3 UUID.

Examples

Example 1

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

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

Parameters

id: string

Returns

boolean