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

Function getHash

docs/pseudo.esm.sh/tinybase@9.0.0/index.js:703–710  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

701);
702var textEncoder = /* @__PURE__ */ new GLOBAL.TextEncoder();
703var getHash = (string) => {
704 let hash = 2166136261;
705 arrayForEach(textEncoder.encode(string), (char) => {
706 hash ^= char;
707 hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24);
708 });
709 return hash >>> 0;
710};
711var addOrRemoveHash = (hash1, hash2) => (hash1 ^ hash2) >>> 0;
712var getValuesHash = (valueHashes) => arrayReduce(
713 objEntries(valueHashes),

Callers 5

common.test.tsFile · 0.90
getValueInValuesHashFunction · 0.70
getValueHashFunction · 0.70
getClientIdFromUniqueIdFunction · 0.70
replaceHlcHashFunction · 0.70

Calls 1

arrayForEachFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…