API reference / @evolu/common / Type / Id
Variable: Id
const Id: BrandType<
Type<"String", string, string, StringError, string, StringError>,
"Id",
IdError,
StringError
>;
Defined in: packages/common/src/Type.ts:1617
Evolu Id: 16 bytes encoded as a 22‑character Base64Url string.
There are three ways to create an Evolu Id:
- createId – default cryptographically secure random bytes (privacy‑preserving)
- createIdFromString – deterministic: first 16 bytes of SHA‑256 of a string
- createIdAsUuidv7 – optional: embeds timestamp bits (UUID v7 layout)
Privacy: the default random Id does not leak creation time and is safe to share or log. The UUID v7 variant leaks creation time anywhere the Id is copied (logs, URLs, exports); only use it when you explicitly want insertion locality for very large write‑heavy tables and accept timestamp exposure.
Future
A possible hybrid masked‑time approach (`timestamp ^ H(cluster_id, timestamp
N)`) could provide locality without exposing raw creation time. See https://brooker.co.za/blog/2025/10/22/uuidv7.html