Skip to content

fingerprintValue

fingerprintValue(value): string

Defined in: packages/core/src/utils/fingerprintValue.ts:19

A short, deterministic fingerprint of a Convex value: equal for structurally equal values (object key order and undefined object entries are ignored, as Convex stores neither), and different for different values with overwhelming probability (53-bit cyrb53).

The client and the server compute it identically, so a writer can name the value its edit started from in about 11 characters instead of re-sending the value — the stale-write guard’s base (see assertFreshBase).

unknown

Any Convex value, or undefined for a missing field.

string

A base-36 fingerprint.

fingerprintValue({ b: 1, a: [true] }) === fingerprintValue({ a: [true], b: 1 }); // true
fingerprintValue({ a: undefined }) === fingerprintValue({}); // true
fingerprintValue(1) === fingerprintValue("1"); // false