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
40
45
50
55
60
65
70
75
80
85
90
94 Batch = detail::makeHashPrefix('B', 'C', 'H'),
95};
96
97template <class Hasher>
98void
99hash_append(Hasher& h, HashPrefix const& hp) noexcept
100{
101 using beast::hash_append;
102 hash_append(h, static_cast<std::uint32_t>(hp));
103}
104
105} // namespace xrpl
void 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:194
HashPrefix
Prefix for hashing functions.
Definition HashPrefix.h:35
@ Validation
validation for signing
Definition HashPrefix.h:74
@ LeafNode
account state
Definition HashPrefix.h:49
@ TxSign
inner transaction to sign
Definition HashPrefix.h:64
@ TransactionId
transaction plus signature to give transaction ID
Definition HashPrefix.h:39
@ TxMultiSign
inner transaction to multi-sign
Definition HashPrefix.h:69
@ InnerNode
inner node in V1 tree
Definition HashPrefix.h:54
@ TxNode
transaction plus metadata
Definition HashPrefix.h:44
@ Proposal
proposal for signing
Definition HashPrefix.h:79