API reference › @evolu/common › local‑first/Timestamp › TimestampBytes

const TimestampBytes: brand(
  "TimestampBytes",
  length(16)(Uint8Array),
  (value) =>
    value[0] === 0xff &&
    value[1] === 0xff &&
    value[2] === 0xff &&
    value[3] === 0xff &&
    value[4] === 0xff &&
    value[5] === 0xff
      ? err<TimestampBytesError>({ type: "TimestampBytes", value })
      : ok(),
  (error) =>
    `The millis part of ${bytesToHex(error.value)} is 2^48 - 1, which Millis reserves for infinity.`,
);

Defined in: packages/common/src/local-first/Timestamp.ts:589

Sortable bytes representation of Timestamp.

Any 16 bytes are valid except a millis part of 2^48 - 1, which Millis reserves for infinity.