benilla-re systems structs docs

s_strHashTable

global · storm

Address
0x80e4e0 · 64 bytes, up to 0x80e51f
Type
const uint32_t[16]
Meaning
Holds the sixteen dwords SStrHash indexes by a byte's high and low nibbles
Confidence
verified, proof two
Finding
storm/strings#seeded-string-hash

Finding: Seeded string hash in storm: string conversions

SStrHash(text, flags, seed) (0x64af90) hashes a name for the texture, sound, map object and language caches. s1 starts at the seed, or 0x7fed7fed for a seed of 0, and s2 at 0xeeeeeeee. With flag bit 0 clear each byte is first folded, a to z down by 0x20 and / to \. For each byte c before the NUL, modulo 2^32: s1 = (s1 + s2) ^ (T[c >> 4] − T[c & 15]), then s2 = s2·33 + c + s1 + 3, with T the sixteen dwords at 0x80e4e0. A result of 0 is returned as 1; a null text sets error 0x57 and returns 0. Every caller passes flags 0 and seed 0.

The derivation is in the doc.