Toolbox-XToolbox-X

Check UUID Versions

Check if a value is a valid UUID of the specified version.

The UUID version checking functions provide type-safe validation for specific UUID versions. Each function checks if a value is a valid UUID of the specified version and returns a TypeScript (branded) type predicate.

isUUIDv1

Checks if a value is a valid UUID version 1 (time-based).

Signature

isUUIDv1(value: unknown): value is UUID<'v1'>

Example

playground.ts

isUUIDv2

Checks if a value is a valid UUID version 2 (DCE security).

Signature

isUUIDv2(value: unknown): value is UUID<'v2'>

Example

playground.ts

isUUIDv3

Checks if a value is a valid UUID version 3 (MD5 hash-based).

Signature

isUUIDv3(value: unknown): value is UUID<'v3'>

Example

playground.ts

isUUIDv4

Checks if a value is a valid UUID version 4 (random).

Signature

isUUIDv4(value: unknown): value is UUID<'v4'>

Example

playground.ts

isUUIDv5

Checks if a value is a valid UUID version 5 (SHA-1 hash-based).

Signature

isUUIDv5(value: unknown): value is UUID<'v5'>

Example

playground.ts

isUUIDv6

Checks if a value is a valid UUID version 6 (reordered time-based).

Signature

isUUIDv6(value: unknown): value is UUID<'v6'>

Example

playground.ts

isUUIDv7

Checks if a value is a valid UUID version 7 (Unix time-based).

Signature

isUUIDv7(value: unknown): value is UUID<'v7'>

Example

playground.ts

isUUIDv8

Checks if a value is a valid UUID version 8 (custom).

Signature

isUUIDv8(value: unknown): value is UUID<'v8'>

Example

playground.ts

Common Usage Pattern

playground.ts

Features

  • Type Predicates: Each function acts as a TypeScript type guard
  • Version-specific Validation: Precisely checks UUID version bits
  • Performance Optimized: Lightweight validation without full parsing
  • RFC Compliant: Follows UUID version specification standards

See Also

  • uuid - Generate UUIDs across all versions
  • decodeUUID - Decode UUIDs into structured information
  • isUUID - General UUID validation (any version). All the version checkers are derived from this guard.

Last updated: Sun, Jun 14, 2026 08:22:19PM (UTC)

On this page