rippled
Loading...
Searching...
No Matches
include
xrpl
beast
hash
uhash.h
1
#pragma once
2
3
#include <xrpl/beast/hash/hash_append.h>
4
#include <xrpl/beast/hash/xxhasher.h>
5
6
namespace
beast
{
7
8
// Universal hash function
9
template
<
class
Hasher = xxhasher>
10
struct
uhash
11
{
12
uhash
() =
default
;
13
14
using
result_type
=
typename
Hasher::result_type;
15
16
template
<
class
T>
17
result_type
18
operator()
(T
const
& t)
const
noexcept
19
{
20
Hasher h;
21
hash_append
(h, t);
22
return
static_cast<
result_type
>
(h);
23
}
24
};
25
26
}
// namespace beast
beast
Definition
base_uint.h:637
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:198
beast::uhash
Definition
uhash.h:11
beast::uhash::uhash
uhash()=default
beast::uhash::operator()
result_type operator()(T const &t) const noexcept
Definition
uhash.h:18
beast::uhash::result_type
typename Hasher::result_type result_type
Definition
uhash.h:14
Generated by
1.9.8