🆔 Generates a random UUID v4 using capability-detected crypto.

Info

Uses the standard Web Crypto API (`globalThis.crypto`).

Syntax

TypeScript
import { uuidv4 } from '@opentf/std';

uuidv4(): string;

Returns

A random UUID v4 string.

Examples

TypeScript
uuidv4() //=> 'f47ac10b-58cc-4372-a567-0e02b2c3d479'
Last updated on
Edit this page