MCPcopy Index your code
hub / github.com/rtfpessoa/diff2html / hashCode

Function hashCode

src/utils.ts:43–54  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

41 * Create unique number identifier for @text
42 */
43export function hashCode(text: string): number {
44 let i, chr, len;
45 let hash = 0;
46
47 for (i = 0, len = text.length; i < len; i++) {
48 chr = text.charCodeAt(i);
49 hash = (hash << 5) - hash + chr;
50 hash |= 0; // Convert to 32bit integer
51 }
52
53 return hash;
54}
55
56/**
57 * @description Finds the maximum value in an array of numbers safely

Callers 2

getHtmlIdFunction · 0.90
utils-tests.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…