MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / hash

Function hash

e2e/src/ports.ts:24–31  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

22// FNV-1a — tiny, deterministic, and the same value in every process of this
23// checkout (globalsetup and test workers must agree on the ports).
24const hash = (text: string): number => {
25 let h = 2166136261;
26 for (let i = 0; i < text.length; i++) {
27 h ^= text.charCodeAt(i);
28 h = Math.imul(h, 16777619);
29 }
30 return h >>> 0;
31};
32
33// 400 blocks of 10 ports in 42000..45999: unprivileged and clear of common dev
34// servers. NOTE: this range is below macOS's ephemeral range (49152+) but sits

Callers 1

ports.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected