I'd hash strings using FNV-hashing, that is XORing the hash by each byte/char of the key & multiplying by a carefully chosen prime.
None of my research states in great detail why these particular primes are chosen but for a 32bit hash 2^24 + 2^8 + 147 = 16,777,619 is IETF-recommended!
For small strings I'd use an internal record mapping from hashes to deduplicated strings, so we can use the string's pointer as it's hash. These strings would be length-prefixed.
As for longer strings...
5/6!!