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

x/oauth2_server/test_deps.ts>v4.validate

A standards compliant implementation of an OAuth 2.0 authorization server with PKCE support.
Latest
function v4.validate
import { v4 } from "https://deno.land/x/oauth2_server@0.12.0/test_deps.ts";
const { validate } = v4;

Validate that the passed UUID is an RFC4122 v4 UUID.

import { validate } from "./v4.ts";
import { generate as generateV1 } from "./v1.ts";

validate(crypto.randomUUID()); // true
validate(generateV1() as string); // false
validate("this-is-not-a-uuid"); // false

Parameters

id: string

Returns

boolean