Skip to content

uuid4

uuid4(): UUID

Defined in: packages/pythonlib/src/uuid.ts:205

Generate a random UUID (version 4).

Uses crypto.randomUUID() when available, otherwise falls back to crypto.getRandomValues().

Returns

UUID

A new random UUID

Example

const id = uuid4()
console.log(id.toString()) // "550e8400-e29b-41d4-a716-446655440000"