MCPcopy Create free account
hub / github.com/garrytan/gstack / stableHash

Function stableHash

scripts/test-free-shards.ts:197–204  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

195}
196
197export function stableHash(input: string): number {
198 let hash = 0x811c9dc5;
199 for (let index = 0; index < input.length; index += 1) {
200 hash ^= input.charCodeAt(index);
201 hash = Math.imul(hash, 0x01000193);
202 }
203 return hash >>> 0;
204}
205
206export function assignFilesToShards(files: string[], shardCount: number): string[][] {
207 if (!Number.isInteger(shardCount) || shardCount <= 0) {

Callers 2

assignFilesToShardsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected