MCPcopy Create free account
hub / github.com/MaxBittker/rs-sdk / hashCode

Method hashCode

server/webclient/src/datastruct/JString.ts:108–118  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

106
107 static hashCode(str: string): bigint {
108 const upper: string = str.toUpperCase();
109 let hash: bigint = 0n;
110
111 for (let i: number = 0; i < upper.length; i++) {
112 hash = hash * 61n + BigInt(upper.charCodeAt(i)) - 32n;
113 hash = (hash + (hash >> 56n)) & 0xffffffffffffffn;
114 }
115
116 return hash;
117 }
118}

Callers 1

getSpriteMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected