API reference › @evolu/common › Type › UuidV4

type UuidV4 = string & Brand<"Uuid"> & Brand<"UuidV4">;

Defined in: packages/common/src/Type.ts:10698

A version 4 Uuid, made of random bits, as produced by crypto.randomUUID().

Example

import { assertErr, assertOk, UuidV4 } from "@evolu/common";

const value = "20354d7a-e4fe-47af-8ff6-187bca92f3f9";
assertOk(UuidV4.fromUnknown(value), value);
assertErr(UuidV4.fromUnknown("0190a6f4-8c3e-7b2a-9d41-5e6f7a8b9c0d"));