MCPcopy Index your code
hub / github.com/refined-github/refined-github / hashString

Function hashString

source/helpers/hash-string.ts:1–10  ·  view source on GitHub ↗
(string: string)

Source from the content-addressed store, hash-verified

1export default function hashString(string: string): string {
2 let hash = 0;
3
4 for (const character of string) {
5 // eslint-disable-next-line no-bitwise -- Low-level hash function
6 hash = ((hash << 5) - hash) + character.codePointAt(0)!;
7 }
8
9 return String(Math.trunc(hash));
10}

Callers 2

github-token.tsFile · 0.85
getCallerIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected