The following members of class QHash are deprecated. They are provided to keep old source code working. We strongly advise against using them in new code.
(deprecated (6.6)) int |
qGlobalQHashSeed() |
(deprecated (6.6)) void |
qSetGlobalQHashSeed(int newSeed) |
[since 5.6]
int qGlobalQHashSeed()This function is deprecated since 6.6. We strongly advise against using it in new code.
Use QHashSeed::globalSeed() instead.
Returns the current global QHash seed.
The seed is set in any newly created QHash. See qHash about how this seed is being used by QHash.
This function was introduced in Qt 5.6.
See also QHashSeed and QHashSeed::globalSeed().
[since 5.6]
void qSetGlobalQHashSeed(int newSeed)This function is deprecated since 6.6. We strongly advise against using it in new code.
Use QHashSeed instead.
Sets the global QHash seed to newSeed.
Manually setting the global QHash seed value should be done only for testing and debugging purposes, when deterministic and reproducible behavior on a QHash is needed. We discourage to do it in production code as it can make your application susceptible to algorithmic complexity attacks.
From Qt 5.10 and onwards, the only allowed values are 0 and -1. Passing the value -1 will reinitialize the global QHash seed to a random value, while the value of 0 is used to request a
stable algorithm for C++ primitive types types (like int
) and string types (QString, QByteArray).
The seed is set in any newly created QHash. See qHash about how this seed is being used by QHash.
If the environment variable QT_HASH_SEED
is set, calling this function will result in a no-op.
This function was introduced in Qt 5.6.
See also QHashSeed::globalSeed() and QHashSeed.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: