|
|
|
@ -30,6 +30,7 @@
@@ -30,6 +30,7 @@
|
|
|
|
|
|
|
|
|
|
#include <libtorrent/sha1_hash.hpp> |
|
|
|
|
|
|
|
|
|
#include <QtGlobal> |
|
|
|
|
#include <QByteArray> |
|
|
|
|
#include <QHash> |
|
|
|
|
#include <QSharedData> |
|
|
|
@ -130,8 +131,16 @@ bool operator<(const Digest32<N> &left, const Digest32<N> &right)
@@ -130,8 +131,16 @@ bool operator<(const Digest32<N> &left, const Digest32<N> &right)
|
|
|
|
|
< static_cast<typename Digest32<N>::UnderlyingType>(right); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) |
|
|
|
|
template <int N> |
|
|
|
|
uint qHash(const Digest32<N> &key, const uint seed) |
|
|
|
|
std::size_t qHash(const Digest32<N> &key, const std::size_t seed = 0) |
|
|
|
|
{ |
|
|
|
|
return ::qHash(std::hash<typename Digest32<N>::UnderlyingType>()(key), seed); |
|
|
|
|
return ::qHash(static_cast<typename Digest32<N>::UnderlyingType>(key), seed); |
|
|
|
|
} |
|
|
|
|
#else |
|
|
|
|
template <int N> |
|
|
|
|
uint qHash(const Digest32<N> &key, const uint seed = 0) |
|
|
|
|
{ |
|
|
|
|
return static_cast<uint>((std::hash<typename Digest32<N>::UnderlyingType> {})(key)) ^ seed; |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|