Hacker News new | ask | show | jobs
by _tom_ 405 days ago
Off-the-cuff thought:

Could you solve the empty string hashes to zero problem by just adding one when computing hash codes?

2 comments

But then strings with the hash code HASH_MAX would wrap to 0 instead.
You could, but that would break backwards compatibility.