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

x/pup/deps.ts>uuid.v5.validate

Universal process manager built in Deno
Go to Latest
function uuid.v5.validate
import { uuid } from "https://deno.land/x/pup@1.0.0-rc.5/deps.ts";
const { validate } = uuid.v5;

Validate that the passed UUID is an RFC4122 v5 UUID.

Examples

Example 1

import { generate as generateV5, validate } from "https://deno.land/std@0.224.0/uuid/v5.ts";

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

Parameters

id: string

Returns

boolean