MCPcopy
hub / github.com/opentrace/opentrace / djb2

Function djb2

ui/src/components/colors/linkColors.ts:59–65  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

57};
58
59function djb2(str: string): number {
60 let h = 5381;
61 for (let i = 0; i < str.length; i++) {
62 h = ((h << 5) + h + str.charCodeAt(i)) | 0;
63 }
64 return Math.abs(h);
65}
66
67// ─── Theme-aware color cache ────────────────────────────────────────────
68

Callers 1

getLinkColorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected