dash/src/saltedhasher.cpp
Alexander Block b5462f5246 Implement std::unordered_map/set compatible hasher classes for salted hashes
Allows convenient salted hashing with unordered maps and sets. Useful when
there is a risk of unbalanced hash buckets slowing things down, e.g. when
externally supplied hashes are used as keys into a map.
2019-02-27 14:40:52 +01:00

13 lines
437 B
C++

// Copyright (c) 2019 The Dash Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "saltedhasher.h"
#include "random.h"
#include <limits>
SaltedHasherBase::SaltedHasherBase() : k0(GetRand(std::numeric_limits<uint64_t>::max())), k1(GetRand(std::numeric_limits<uint64_t>::max())) {}
SaltedHasherBase StaticSaltedHasher::s;