mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
New hash_append robust container hash function framework:
* is_contiguous_hashable trait identifies optimizable types * hash_append() function overloads for basic types: - scalars, floats - array, C array - pair, tuple - boost array and tuple (if configured) * Provided Spooky hash wrapper for use with hash_append * Use hash_append in hardened_hash and other places * New Utility meta functions for working with variadics: - static_and - static_sum * Added type_name utility function for diagnostics * hash_metrics suite of functions to evalulate hash functions * Test suites to measure hash function performance * Various fixes
This commit is contained in:
committed by
Vinnie Falco
parent
6b467e7e59
commit
2ab7cfbf30
@@ -51,10 +51,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
hash_combine (std::size_t& seed) const noexcept
|
||||
template <class Hasher>
|
||||
friend void hash_append (Hasher& h, test_user_type_member const& a) noexcept
|
||||
{
|
||||
boost::hash_combine (seed, t);
|
||||
using beast::hash_append;
|
||||
hash_append (h, a.t);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -70,12 +71,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
friend
|
||||
void
|
||||
hash_combine (std::size_t& seed,
|
||||
test_user_type_free const& v) noexcept
|
||||
template <class Hasher>
|
||||
friend void hash_append (Hasher& h, test_user_type_free const& a) noexcept
|
||||
{
|
||||
boost::hash_combine (seed, v.t);
|
||||
using beast::hash_append;
|
||||
hash_append (h, a.t);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -154,11 +154,11 @@ public:
|
||||
return &m_vec[0];
|
||||
}
|
||||
|
||||
void
|
||||
hash_combine (std::size_t& seed) const noexcept
|
||||
template <class Hasher>
|
||||
friend void hash_append(Hasher& h, unsigned_integer const& a) noexcept
|
||||
{
|
||||
for (std::size_t i (0); i < size; ++i)
|
||||
boost::hash_combine (seed, m_vec[i]);
|
||||
using beast::hash_append;
|
||||
hash_append (h, a.m_vec);
|
||||
}
|
||||
|
||||
friend
|
||||
|
||||
Reference in New Issue
Block a user