hashSeed function
Last updated: 2026-03-05T10:53:28.864Z
Location
Metrics
LOC: 8
Complexity: 2
Params: 1
Signature
hashSeed(seed: string): : number
Summary
FNV-1a–style hash producing a 32-bit unsigned integer from a string. Used purely for seeding — not for cryptographic purposes.
Source Code
function hashSeed(seed: string): number {
let h = 0x811c9dc5; // FNV offset basis
for (let i = 0; i < seed.length; i++) {
h ^= seed.charCodeAt(i);
h = Math.imul(h, 0x01000193); // FNV prime
}
return h >>> 0;
}
No outgoing dependencies.
Impact (Incoming)
| Source | Type |
|---|---|
| createSeededRng | calls |