MCPcopy Create free account
hub / github.com/Effect-TS/effect / hashString

Function hashString

packages/effect/src/unstable/cluster/internal/hash.ts:17–23  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

15
16/** @internal */
17export const hashString = (str: string) => {
18 let h = 5381, i = str.length
19 while (i) {
20 h = (h * 33) ^ str.charCodeAt(--i)
21 }
22 return hashOptimize(h)
23}

Callers 2

makeShardIdFunction · 0.90
getShardIdFunction · 0.90

Calls 1

hashOptimizeFunction · 0.85

Tested by

no test coverage detected