API reference@evolu/commonType › idBytesToId

function idBytesToId(
  value: Uint8Array<ArrayBufferLike> & Brand<"Length16"> & Brand<"IdBytes">,
): string & Brand<"Id">;

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

Converts IdBytes to an Id.

Example

import {
  assertEqual,
  createIdFromString,
  idBytesToId,
  idToIdBytes,
} from "@evolu/common";

const value = createIdFromString("todo");

assertEqual(idBytesToId(idToIdBytes(value)), value);