rippled
Loading...
Searching...
No Matches
include
xrpl
beast
hash
uhash.h
1
#ifndef BEAST_HASH_UHASH_H_INCLUDED
2
#define BEAST_HASH_UHASH_H_INCLUDED
3
4
#include <xrpl/beast/hash/hash_append.h>
5
#include <xrpl/beast/hash/xxhasher.h>
6
7
namespace
beast
{
8
9
// Universal hash function
10
template
<
class
Hasher = xxhasher>
11
struct
uhash
12
{
13
uhash
() =
default
;
14
15
using
result_type
=
typename
Hasher::result_type;
16
17
template
<
class
T>
18
result_type
19
operator()
(T
const
& t)
const
noexcept
20
{
21
Hasher h;
22
hash_append
(h, t);
23
return
static_cast<
result_type
>
(h);
24
}
25
};
26
27
}
// namespace beast
28
29
#endif
beast
Definition
base_uint.h:653
beast::hash_append
std::enable_if_t< is_contiguously_hashable< T, Hasher >::value > hash_append(Hasher &h, T const &t) noexcept
Logically concatenate input data to a Hasher.
Definition
hash_append.h:214
beast::uhash
Definition
uhash.h:12
beast::uhash::uhash
uhash()=default
beast::uhash::operator()
result_type operator()(T const &t) const noexcept
Definition
uhash.h:19
beast::uhash::result_type
typename Hasher::result_type result_type
Definition
uhash.h:15
Generated by
1.9.8