Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/web_bson/test_deps.ts>UUID.v5.validate

web_bson is a fork from mongodb/js-bson
Very Popular
Go to Latest
function UUID.v5.validate
import { UUID } from "https://deno.land/x/web_bson@v0.2.4/test_deps.ts";
const { validate } = UUID.v5;

Validate that the passed UUID is an RFC4122 v5 UUID.

import { generate as generateV5, validate } from "./v5.ts";

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

Parameters

id: string

Returns

boolean