Let me rephrase that, then:
Don't mod the hashvalue unless you want to destroy the uniqueness distribution of the has function, or if it is acceptable to do so, or you have no other choice.
This is a discussion on How to use string hash function within the C++ Programming forums, part of the General Programming Boards category; Let me rephrase that, then: Don't mod the hashvalue unless you want to destroy the uniqueness distribution of the has ...
Let me rephrase that, then:
Don't mod the hashvalue unless you want to destroy the uniqueness distribution of the has function, or if it is acceptable to do so, or you have no other choice.
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
That's normal, now you need to do mod size_1 as you thought earlier.That's because that site's example is for old C code, but you are using C++. Adding the const was the correct thing to do to port it to modern C++.The parameters to use are corrrect according to the official site @ http://www.isthe.com/chongo/tech/comp/fnv/That's not necessary. FNV-1a is very good, and the problem was with how you were trying to use it. Any other hashing function will behave the same, and if you can't use this one right, you wont be able to use any other right either.... I'll look around for other string hash functions and try to resolve this...
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"