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

Function getHash

src/common/hash.ts:24–32  ·  view source on GitHub ↗
(string: string)

Source from the content-addressed store, hash-verified

22
23// fnv1a
24export const getHash: typeof getHashDecl = (string: string): Hash => {
25 let hash = 0x811c9dc5;
26 arrayForEach(textEncoder.encode(string), (char) => {
27 hash ^= char;
28 hash +=
29 (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24);
30 });
31 return hash >>> 0;
32};
33
34export const addOrRemoveHash: typeof addOrRemoveHashDecl = (
35 hash1: Hash,

Callers 5

getValueInValuesHashFunction · 0.90
getValueHashFunction · 0.90
getClientIdFromUniqueIdFunction · 0.90
replaceHlcHashFunction · 0.90

Calls 1

arrayForEachFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…