Skip to contents

Validate UUID format to catch malformed IDs early, before they cause database errors or security issues.

Usage

validate_uuid(uuid, param_name = "UUID")

Arguments

uuid

UUID string to validate.

param_name

Name to use in error messages for clarity.

Value

Invisible TRUE if valid, otherwise throws an error.

Functions

  • validate_uuid(): Validate UUID format

See also

Other uuid: gen-uuid

Examples

validate_uuid("12345678-1234-1234-1234-123456789abc")

if (FALSE) { # \dontrun{
validate_uuid("invalid-uuid")
validate_uuid(NULL, "Artist ID")
} # }