How does Qt calculate a hash value for a string?
Does anyone here know that?
How does Qt calculate a hash value for a string?
Does anyone here know that?
are we talking about QCryptographicHash ?
coz qHash is used for a different purpose i think.
I'm talking about the hashvalue that is calculated for a QString when inserted into a QHash<QString, some_type>
well. then you can just take a look at the qt sources for qHash function..
The principle is exactly the same, except that cryptographic hash should have a larger number of possible results (value space).
An easy (although completely useless) qHash implementation would be to sum the ascii values of all characters in the string and return that as a value (normalized to the value space).
Bookmarks