Skip to content

utils/uuid

Documentation

Overview

Classes

UUID

random()

Generates a new random UUID (Type 4). The generated string is typically in the format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx.

ts
static random(): string;

Returns

  • Type: string
  • Description: A string representing the newly generated UUID.

validate()

Validates if the provided string conforms to the standard UUID format (e.g., a valid 36-character string including hyphens).

ts
static validate(input: string): boolean;
ParameterTypeDescription
inputstringThe string to validate.

Returns

  • Type: boolean
  • Description: true if the input string is a valid UUID, false otherwise.