Can anyone suggest a good string hashing template to use? I had a look at katcl's one and it was complicated also tourist didn't have any string hashing algorithm on his github. I tried to implement it myself but I was not very good with c++ syntax to be able to write it my self. So any suggestions?
Does this work?
I haven't benchmarked it thoroughly, but it should be fairly fast and easy to use.
Thanks. It seems easy to work. But it is a bit strange in my openion using ull will make arithmetic a bit hard ? won't it like subracting a small number from a big one
Used the unsigned type because it's typically faster. There was a minor issue while subtracting hashes due to the use of the unsigned type which I've just fixed.
If you use it as a template, you wouldn't usually need to add/subtract hashes. So it doesn't matter much what type you use.
I see there is no need for subtractiong thanks!
Template that supports only two hashes (which is typically enough though).