diff options
author | Andrew Chow <achow101-github@achow101.com> | 2019-09-17 19:29:59 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-11-10 14:33:37 -0500 |
commit | 210b693db66e7c5b618014b5a287aee15af00045 (patch) | |
tree | 4615e9c69c139d3441d20b65011417a59ecb7cdf /src/util/hasher.h | |
parent | 95e61c1cf2a91d041c8025306ba36f0ea2806894 (diff) | |
download | bitcoin-210b693db66e7c5b618014b5a287aee15af00045.tar.xz |
Add generic SaltedSipHasher
SaltedSipHasher is a generic hasher that can be used with most things we
would hash in an unordered container.
Diffstat (limited to 'src/util/hasher.h')
-rw-r--r-- | src/util/hasher.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util/hasher.h b/src/util/hasher.h index 77301df63d..fa2fea30d8 100644 --- a/src/util/hasher.h +++ b/src/util/hasher.h @@ -84,4 +84,16 @@ struct BlockHasher size_t operator()(const uint256& hash) const { return ReadLE64(hash.begin()); } }; +class SaltedSipHasher +{ +private: + /** Salt */ + const uint64_t m_k0, m_k1; + +public: + SaltedSipHasher(); + + size_t operator()(const Span<const unsigned char>& script) const; +}; + #endif // BITCOIN_UTIL_HASHER_H |