refactor: make GetRand a template, remove GetRandInt

This commit is contained in:
pasta
2022-01-31 19:32:59 +07:00
parent 505ba39665
commit ab1ea29ba1
12 changed files with 34 additions and 31 deletions

View File

@@ -6,10 +6,10 @@
#include <random.h>
#include <util/bytevectorhash.h>
ByteVectorHash::ByteVectorHash()
ByteVectorHash::ByteVectorHash() :
m_k0(GetRand<uint64_t>()),
m_k1(GetRand<uint64_t>())
{
GetRandBytes({reinterpret_cast<unsigned char*>(&m_k0), sizeof(m_k0)});
GetRandBytes({reinterpret_cast<unsigned char*>(&m_k1), sizeof(m_k1)});
}
size_t ByteVectorHash::operator()(const std::vector<unsigned char>& input) const