MCPcopy Create free account
hub / github.com/MALSync/MALSync / createShortHash

Function createShortHash

src/pages-chibi/builder/chibiHelper.ts:46–55  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

44}
45
46function createShortHash(str: string): string {
47 let hash = 0;
48 for (let i = 0; i < str.length; i++) {
49 const char = str.charCodeAt(i);
50 hash = (hash << 5) - hash + char;
51 hash &= hash;
52 }
53
54 return (hash >>> 0).toString(16).slice(-8).padStart(8, '0');
55}
56
57export function chibiList(pages: { [key: string]: PageInterface }): PageListJsonInterface {
58 const definitions: PageListJsonInterface = {

Callers 1

getVersionHashesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected