xrpld
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
= 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:673
beast::hash_append
std::enable_if_t< IsContiguouslyHashable< T, Hasher >::value > hash_append(Hasher &h, T const &t) noexcept
Logically concatenate input data to a Hasher.
Definition
hash_append.h:204
beast::Uhash::operator()
result_type operator()(T const &t) const noexcept
Definition
uhash.h:18
beast::Uhash::Uhash
Uhash()=default
beast::Uhash::result_type
Hasher::result_type result_type
Definition
uhash.h:14
Generated by
1.16.1