Hacker News new | ask | show | jobs
by pacaro 3225 days ago
Yeah, reading through that jumped out at me.

Also the use of strdup, while a reasonable choice, should also come with caveats about ownership and copying

I stopped at the use of pow for exponentiation in the hash function. Just iteratively multiply your factor and take the modulus on each round.

This would handle utf-8 just fine if characters are cast to unsigned in the hash function and a larger prime factor is used

None of these are real criticisms, I'd just love to see a pointer to more in depth information on how to really write hash functions

I hope that i missed it, but this definitely needs a clear statement that this is a pedagogical exercise and not a production ready implementation