Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include <stdlib.h>
#include <stdint.h>
#include "qhash.h"
#include <qbitarray.h>
#include <qstring.h>
#include <qglobal.h>
#include <qbytearray.h>
#include <qdatetime.h>
#include <qbasicatomic.h>
#include <qendian.h>
#include <private/qrandom_p.h>
#include <private/qsimd_p.h>
#include <qcoreapplication.h>
#include <qrandom.h>
#include <private/qlocale_tools_p.h>
#include <array>
#include <limits.h>
#include <assert.h>
Go to the source code of this file.
Macros | |
#define | _CRT_RAND_S |
#define | Q_DECL_HOT_FUNCTION |
#define | ROTL(x, b) (((x) << (b)) | ((x) >> (sizeof(x) * 8 - (b)))) |
#define | SIPROUND |
#define | SIPROUND |
Enumerations | |
enum | ZeroExtension { None = 0 , ByteToWord = 1 } |
Functions | |
QT_BEGIN_NAMESPACE void | qt_from_latin1 (char16_t *dst, const char *str, size_t size) noexcept |
Q_NEVER_INLINE static Q_DECL_HOT_FUNCTION uint64_t | murmurhash (const void *key, uint64_t len, uint64_t seed) noexcept |
Q_NEVER_INLINE static Q_DECL_HOT_FUNCTION size_t | siphash (const uint8_t *in, size_t inlen, size_t seed, size_t seed2) |
template<ZeroExtension = None> | |
static size_t | qHashBits_fallback (const uchar *p, size_t size, size_t seed, size_t seed2) noexcept |
template<> | |
size_t | qHashBits_fallback< None > (const uchar *p, size_t size, size_t seed, size_t seed2) noexcept |
template<> | |
size_t | qHashBits_fallback< ByteToWord > (const uchar *data, size_t size, size_t seed, size_t seed2) noexcept |
size_t | qHashBits (const void *p, size_t size, size_t seed) noexcept |
size_t | qHash (QByteArrayView key, size_t seed) noexcept |
size_t | qHash (QStringView key, size_t seed) noexcept |
size_t | qHash (const QBitArray &bitArray, size_t seed) noexcept |
size_t | qHash (QLatin1StringView key, size_t seed) noexcept |
uint | qt_hash (QStringView key, uint chained) noexcept |
Variables | |
static Q_CONSTINIT HashSeedStorage | qt_qhash_seed |
#define SIPROUND |
#define SIPROUND |
enum ZeroExtension |
|
inlinestaticnoexcept |
Definition at line 240 of file qhash.cpp.
References seed.
Referenced by QHash< Key, T >::qHash(), QHash< Key, T >::qHash(), qHashBits_fallback< ByteToWord >(), and qHashBits_fallback< None >().
|
related |
|
noexcept |
Definition at line 1114 of file qhash.cpp.
References qHashBits(), and seed.
|
related |
|
related |
|
related |
Definition at line 1089 of file qhash.cpp.
Referenced by QTlsPrivate::X509CertificateOpenSSL::hash(), qHash(), qHash(), qHash(), qHash(), qHash(), and QStringView::qHash().
|
staticnoexcept |
|
noexcept |
Definition at line 545 of file qhash.cpp.
References murmurhash(), qt_from_latin1(), QT_POINTER_SIZE, seed, and siphash().
Referenced by QHash< Key, T >::qHash().
|
noexcept |
Definition at line 537 of file qhash.cpp.
References murmurhash(), QT_POINTER_SIZE, seed, and siphash().
|
noexcept |
Definition at line 920 of file qstring.cpp.
Referenced by QAbstractConcatenable::appendLatin1To(), argToQStringImpl(), QLatin1::convertToUnicode(), QString::fromLatin1(), insert_helper(), QString::operator=(), qHashBits_fallback< ByteToWord >(), and qt_from_latin1_to_qvla().
|
noexcept |
Private copy of the implementation of the Qt 4 qHash algorithm for strings, (that is, QChar-based arrays, so all QString-like classes), to be used wherever the result is somehow stored or reused across multiple Qt versions. The public qHash implementation can change at any time, therefore one must not rely on the fact that it will always give the same results.
The qt_hash functions must never change their results.
This function can hash discontiguous memory by invoking it on each chunk, passing the previous's result in the next call's chained argument.
Definition at line 1325 of file qhash.cpp.
Referenced by qt_rcc_compare_hash::operator()(), and RCCFileInfo::writeDataName().
|
static |
Definition at line 522 of file qhash.cpp.
References seed.
Referenced by qHashBits_fallback< ByteToWord >(), and qHashBits_fallback< None >().
|
static |
Definition at line 174 of file qhash.cpp.
Referenced by QHashSeed::globalSeed(), QHash< Key, T >::qHash(), QHash< Key, T >::qHashBits(), QHashSeed::resetRandomGlobalSeed(), and QHashSeed::setDeterministicGlobalSeed().