From fef5adcc331c4d7b92b71e03fc8a73343a865599 Mon Sep 17 00:00:00 2001 From: Jim Posen Date: Mon, 20 Aug 2018 23:35:29 -0700 Subject: blockfilter: Use unordered_set instead of set in blockfilter. --- src/util/bytevectorhash.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/util/bytevectorhash.cpp (limited to 'src/util/bytevectorhash.cpp') diff --git a/src/util/bytevectorhash.cpp b/src/util/bytevectorhash.cpp new file mode 100644 index 000000000..f87d0e04b --- /dev/null +++ b/src/util/bytevectorhash.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2018 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include +#include + +ByteVectorHash::ByteVectorHash() +{ + GetRandBytes(reinterpret_cast(&m_k0), sizeof(m_k0)); + GetRandBytes(reinterpret_cast(&m_k1), sizeof(m_k1)); +} + +size_t ByteVectorHash::operator()(const std::vector& input) const +{ + return CSipHasher(m_k0, m_k1).Write(input.data(), input.size()).Finalize(); +} -- cgit v1.2.3