diff --git a/include/opendht/infohash.h b/include/opendht/infohash.h index e4b353ecafa359946af76ccd70680e46a09ff6a6..26d82d52dde907b128fafef5a4219b51d748473f 100644 --- a/include/opendht/infohash.h +++ b/include/opendht/infohash.h @@ -198,22 +198,3 @@ public: }; } - -namespace std -{ - template<> - struct hash<dht::InfoHash> - { - typedef dht::InfoHash argument_type; - typedef std::size_t result_type; - - result_type operator()(dht::InfoHash const& s) const - { - result_type r {}; - std::hash<uint8_t> hash_fn; - for (size_t i = 0; i < HASH_LEN; i++) - r = r ^ (hash_fn(s[i]) << i*4); - return r; - } - }; -} diff --git a/python/opendht.pyx b/python/opendht.pyx index f226945f734cc32dfae551b6e50df6512b544811..d7b1c485d0b5f3dfe11c46a5ffae5a6e26bd7c93 100644 --- a/python/opendht.pyx +++ b/python/opendht.pyx @@ -84,9 +84,6 @@ cdef class InfoHash(_WithID): if op == 2: return self._infohash == other._infohash return NotImplemented - def __hash__(self): - cdef cpp.hash[cpp.InfoHash] hash_fn - return hash_fn.get(self._infohash) def getBit(InfoHash self, bit): return self._infohash.getBit(bit) def setBit(InfoHash self, bit, b):