MCPcopy Index your code
hub / github.com/tinyplex/tinybase / getValuesHash

Function getValuesHash

src/common/hash.ts:39–51  ·  view source on GitHub ↗
(valueHashes: {
  [valueId: Id]: Hash;
})

Source from the content-addressed store, hash-verified

37): Hash => (hash1 ^ hash2) >>> 0;
38
39export const getValuesHash: typeof getValuesHashDecl = (valueHashes: {
40 [valueId: Id]: Hash;
41}): Hash =>
42 arrayReduce(
43 objEntries(valueHashes),
44 (valuesHash, [valueId, valueHash]) =>
45 addOrRemoveHash(
46 valuesHash,
47 getValueInValuesHash(valueId, valueHash) ^
48 getValueInValuesHash(valueId, 0), // legacy v5; remove in v7
49 ),
50 0, // legacy v5; valuesHlc in v7?
51 );
52
53export const getValueInValuesHash: typeof getValueHashInValuesDecl = (
54 valueId: Id,

Callers

nothing calls this directly

Calls 3

arrayReduceFunction · 0.90
addOrRemoveHashFunction · 0.90
getValueInValuesHashFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…