Go to file
Giuseppe D'Angelo ddb70bee2f Stop relying on qHash always giving the same results
The implementation of the various qHash overloads offered by
Qt can change at any time for any reason
(speed, quality, security, ...).

Therefore, relying on the fact that qHash will always give
an identical result across Qt versions (... across different
processes, etc.), given identical input, is wrong.
Note that this also implies that one cannot rely on QHash
having a stable ordering (even without the random qHash seed).

For such use cases, one must use f.i. a private hash function
that will never change outside his own control.

This patch adds a private hash function for QStrings,
which is identical to the Qt(4) qHash(QString) implementation.
A couple of spots in Qt where the results of a qHash call were
actually saved on disk are ported to use the new function,
and a bit of documentation is added to QHash docs.

Change-Id: Ia3731ea26ac68649b535b95e9f36fbec3df693c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-08 21:44:26 +02:00
bin Fix qtmodule-configtests to honor error codes 2012-03-08 23:52:34 +01:00
config.tests Merge master into api_changes 2012-03-27 19:22:48 +02:00
dist QHash security fix (1.5/2): qHash two arguments overload support 2012-04-04 13:02:58 +02:00
doc/src QHash security fix (1.5/2): qHash two arguments overload support 2012-04-04 13:02:58 +02:00
examples Merge master into api_changes 2012-03-23 14:10:58 +01:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs Merge master into api_changes 2012-03-27 19:22:48 +02:00
qmake Remove -DQT_NO_STL from the bootstrapped builds 2012-04-07 05:19:56 +02:00
src Stop relying on qHash always giving the same results 2012-04-08 21:44:26 +02:00
tests QHostAddress: improve qHash implementation 2012-04-08 18:25:10 +02:00
tools Remove -DQT_NO_STL from the bootstrapped builds 2012-04-07 05:19:56 +02:00
util Stop relying on qHash always giving the same results 2012-04-08 21:44:26 +02:00
.gitattributes Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
.gitignore device: Add -device and -device-option to configure 2012-03-27 05:35:57 +02:00
.tag Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
configure Remove the -no-stl option from configure 2012-03-28 16:31:34 +02:00
configure.bat Remove Q_BYTE_ORDER and -*-endian arguments from configures 2012-03-02 14:48:00 +01:00
header.BSD Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.FDL Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.LGPL Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.LGPL-ONLY Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
INSTALL Remove Symbian specific code from qtbase. 2012-01-31 07:08:31 +01:00
LGPL_EXCEPTION.txt Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.LGPL Update contact information in license headers. 2012-01-23 04:04:33 +01:00
LICENSE.PREVIEW.COMMERCIAL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
qtbase.pro device: Add -device and -device-option to configure 2012-03-27 05:35:57 +02:00
sync.profile Add qprocessordetection.h 2012-02-08 12:33:11 +01:00