mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Refactoring of container usage:
* New ripple container aliases use hardened_hash * Use std::tuple instead of boost::tuple * Use std unordered containers instead of boost * Fix Destroyer for new containers * Fix warning for fnv1a on 32-bit arch * Validator fixes for new containers
This commit is contained in:
committed by
Vinnie Falco
parent
8f5b4a6c96
commit
fdfcebd1cb
@@ -119,10 +119,13 @@ public:
|
||||
|
||||
namespace hash_append_tests {
|
||||
|
||||
class fnv1a
|
||||
template <std::size_t> class fnv1a_imp;
|
||||
|
||||
template <>
|
||||
class fnv1a_imp<64>
|
||||
{
|
||||
private:
|
||||
std::size_t state_ = 14695981039346656037u;
|
||||
std::uint64_t state_ = 14695981039346656037u;
|
||||
|
||||
public:
|
||||
void
|
||||
@@ -141,6 +144,35 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
class fnv1a_imp<32>
|
||||
{
|
||||
private:
|
||||
std::uint32_t state_ = 2166136261;
|
||||
|
||||
public:
|
||||
void
|
||||
append (void const* key, std::size_t len) noexcept
|
||||
{
|
||||
unsigned char const* p = static_cast<unsigned char const*>(key);
|
||||
unsigned char const* const e = p + len;
|
||||
for (; p < e; ++p)
|
||||
state_ = (state_ ^ *p) * 16777619;
|
||||
}
|
||||
|
||||
explicit
|
||||
operator std::size_t() noexcept
|
||||
{
|
||||
return state_;
|
||||
}
|
||||
};
|
||||
|
||||
class fnv1a
|
||||
: public fnv1a_imp<CHAR_BIT*sizeof(std::size_t)>
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
class jenkins1
|
||||
{
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user