xrpld
Loading...
Searching...
No Matches
HashPrefix.h
1#pragma once
2
3#include <xrpl/beast/hash/hash_append.h>
4
5#include <cstdint>
6
7namespace xrpl {
8
9namespace detail {
10
11constexpr std::uint32_t
12makeHashPrefix(char a, char b, char c)
13{
14 return (static_cast<std::uint32_t>(a) << 24) + (static_cast<std::uint32_t>(b) << 16) +
15 (static_cast<std::uint32_t>(c) << 8);
16}
17
18} // namespace detail
19
37
40
43
46
49
52
55
58
61
64
67
69 Batch = detail::makeHashPrefix('B', 'C', 'H'),
70};
71
72template <class Hasher>
73void
74hash_append(Hasher& h, HashPrefix const& hp) noexcept
75{
77 hash_append(h, static_cast<std::uint32_t>(hp));
78}
79
80} // namespace xrpl
std::enable_if_t< IsContiguouslyHashable< T, Hasher >::value > hash_append(Hasher &h, T const &t) noexcept
Logically concatenate input data to a Hasher.
constexpr std::uint32_t makeHashPrefix(char a, char b, char c)
Definition HashPrefix.h:12
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
void hash_append(Hasher &h, Slice const &v)
Definition Slice.h:175
HashPrefix
Prefix for hashing functions.
Definition HashPrefix.h:34
@ Validation
validation for signing
Definition HashPrefix.h:57
@ LeafNode
account state
Definition HashPrefix.h:42
@ TxSign
inner transaction to sign
Definition HashPrefix.h:51
@ TransactionId
transaction plus signature to give transaction ID
Definition HashPrefix.h:36
@ TxMultiSign
inner transaction to multi-sign
Definition HashPrefix.h:54
@ InnerNode
inner node in V1 tree
Definition HashPrefix.h:45
@ TxNode
transaction plus metadata
Definition HashPrefix.h:39
@ Proposal
proposal for signing
Definition HashPrefix.h:60