33 using value_type = size_t;
34 template<
class H = Hash>
35 static value_type
hash(
const Object& obj);
37 static value_type
hash(
const std::vector<uint8_t>& raw);
38 static value_type
hash(span<const uint8_t> raw);
39 static value_type
hash(
const void* raw,
size_t size);
42 template<
typename U = value_type>
43 static value_type
combine(value_type lhs, U rhs) {
44 return (lhs ^ rhs) + 0x9e3779b9 + (lhs << 6) + (rhs >> 2);
50 Hash(value_type init_value);
54 virtual Hash&
process(
const std::string& str);
55 virtual Hash&
process(
const std::u16string& str);
56 virtual Hash&
process(
const std::vector<uint8_t>& raw);
57 virtual Hash&
process(span<const uint8_t> raw);
59 template<class T, typename = typename std::enable_if<std::is_enum<T>::value>::type>
61 return process(
static_cast<value_type
>(v));
66 return process(std::begin(v), std::end(v));
70 template<
class T,
size_t N>
71 Hash&
process(
const std::array<T, N>& array) {
72 process(std::begin(array), std::end(array));
77 Hash&
process(
const std::vector<T>& vector) {
78 process(std::begin(vector), std::end(vector));
84 process(std::begin(set), std::end(set));
88 template<
class U,
class V>
95 template<
class InputIt>
96 Hash&
process(InputIt begin, InputIt end) {
97 for (
auto&& it = begin; it != end; ++it) {
110 value_type value_ = 0;
118template<
class Hasher>
122 return hasher.value();
static value_type hash(span< const uint8_t > raw)
virtual Hash & process(const std::u16string &str)
virtual Hash & process(span< const uint8_t > raw)
Hash & process(const std::array< T, N > &array)
Definition hash.hpp:71
static value_type combine(value_type lhs, U rhs)
Definition hash.hpp:43
Hash & process(InputIt begin, InputIt end)
Definition hash.hpp:96
virtual Hash & process(const std::string &str)
virtual Hash & process(size_t integer)
size_t value_type
Definition hash.hpp:33
static value_type hash(const Object &obj)
Definition hash.hpp:119
Hash & process(const std::vector< T > &vector)
Definition hash.hpp:77
Hash(value_type init_value)
virtual Hash & process(const std::vector< uint8_t > &raw)
Hash & process(const std::pair< U, V > &p)
Definition hash.hpp:89
static value_type hash(const void *raw, size_t size)
static value_type hash(const std::vector< uint8_t > &raw)
value_type value() const
Definition hash.hpp:103
Hash & process(T v)
Definition hash.hpp:60
Hash & process(typename It::iterator v)
Definition hash.hpp:65
virtual Hash & process(const Object &obj)
Hash & process(const std::set< T > &set)
Definition hash.hpp:83
virtual void accept(Visitor &visitor) const =0
Definition Visitor.hpp:225
LIEF namespace.
Definition Abstract/Binary.hpp:36
tcb::span< ElementType, Extent > span
Definition span.hpp:22
Hash::value_type hash(const Object &v)
#define LIEF_API
Definition visibility.h:41