xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
protocol
HashPrefix.h
1
#pragma once
2
3
#include <xrpl/beast/hash/hash_append.h>
4
5
#include <
cstdint
>
6
7
namespace
xrpl
{
8
9
namespace
detail
{
10
11
constexpr
std::uint32_t
12
makeHashPrefix
(
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
35
enum class
HashPrefix
:
std::uint32_t
{
39
TransactionId
=
detail::makeHashPrefix
(
'T'
,
'X'
,
'N'
),
40
44
TxNode
=
detail::makeHashPrefix
(
'S'
,
'N'
,
'D'
),
45
49
LeafNode
=
detail::makeHashPrefix
(
'M'
,
'L'
,
'N'
),
50
54
InnerNode
=
detail::makeHashPrefix
(
'M'
,
'I'
,
'N'
),
55
59
LedgerMaster
=
detail::makeHashPrefix
(
'L'
,
'W'
,
'R'
),
60
64
TxSign
=
detail::makeHashPrefix
(
'S'
,
'T'
,
'X'
),
65
69
TxMultiSign
=
detail::makeHashPrefix
(
'S'
,
'M'
,
'T'
),
70
74
Validation
=
detail::makeHashPrefix
(
'V'
,
'A'
,
'L'
),
75
79
Proposal
=
detail::makeHashPrefix
(
'P'
,
'R'
,
'P'
),
80
84
Manifest
=
detail::makeHashPrefix
(
'M'
,
'A'
,
'N'
),
85
89
PaymentChannelClaim
=
detail::makeHashPrefix
(
'C'
,
'L'
,
'M'
),
90
94
Batch
=
detail::makeHashPrefix
(
'B'
,
'C'
,
'H'
),
95
99
CounterpartyTxSign
=
detail::makeHashPrefix
(
'C'
,
'P'
,
'T'
),
100
104
CounterpartyTxMultiSign
=
detail::makeHashPrefix
(
'C'
,
'P'
,
'M'
),
105
109
SponsorTxSign
=
detail::makeHashPrefix
(
'S'
,
'P'
,
'N'
),
110
114
SponsorTxMultiSign
=
detail::makeHashPrefix
(
'S'
,
'P'
,
'M'
),
115
};
116
117
template
<
class
Hasher>
118
void
119
hash_append
(Hasher& h,
HashPrefix
const
& hp)
noexcept
120
{
121
using
beast::hash_append
;
122
hash_append
(h,
static_cast<
std::uint32_t
>
(hp));
123
}
124
125
}
// namespace xrpl
xrpl::Batch
Definition
tx/transactors/system/Batch.h:20
xrpl::LedgerMaster
Tracks the current ledger and any ledgers in the process of closing.
Definition
LedgerMaster.h:122
xrpl::PaymentChannelClaim
Definition
tx/transactors/payment_channel/PaymentChannelClaim.h:17
cstdint
std::uint32_t
beast::hash_append
void hash_append(Hasher &h, T const &t) noexcept
Logically concatenate input data to a Hasher.
Definition
hash_append.h:206
xrpl::detail
Definition
base_uint.h:37
xrpl::detail::makeHashPrefix
constexpr std::uint32_t makeHashPrefix(char a, char b, char c)
Definition
HashPrefix.h:12
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::hash_append
void hash_append(Hasher &h, Slice const &v)
Definition
Slice.h:194
xrpl::HashPrefix
HashPrefix
Prefix for hashing functions.
Definition
HashPrefix.h:35
xrpl::HashPrefix::Validation
@ Validation
validation for signing
Definition
HashPrefix.h:74
xrpl::HashPrefix::CounterpartyTxMultiSign
@ CounterpartyTxMultiSign
inner transaction to multi-sign as the counterparty
Definition
HashPrefix.h:104
xrpl::HashPrefix::LeafNode
@ LeafNode
account state
Definition
HashPrefix.h:49
xrpl::HashPrefix::TxSign
@ TxSign
inner transaction to sign
Definition
HashPrefix.h:64
xrpl::HashPrefix::TransactionId
@ TransactionId
transaction plus signature to give transaction ID
Definition
HashPrefix.h:39
xrpl::HashPrefix::SponsorTxSign
@ SponsorTxSign
inner transaction to sign as the sponsor
Definition
HashPrefix.h:109
xrpl::HashPrefix::TxMultiSign
@ TxMultiSign
inner transaction to multi-sign
Definition
HashPrefix.h:69
xrpl::HashPrefix::InnerNode
@ InnerNode
inner node in V1 tree
Definition
HashPrefix.h:54
xrpl::HashPrefix::TxNode
@ TxNode
transaction plus metadata
Definition
HashPrefix.h:44
xrpl::HashPrefix::Proposal
@ Proposal
proposal for signing
Definition
HashPrefix.h:79
xrpl::HashPrefix::CounterpartyTxSign
@ CounterpartyTxSign
inner transaction to sign as the counterparty
Definition
HashPrefix.h:99
xrpl::HashPrefix::SponsorTxMultiSign
@ SponsorTxMultiSign
inner transaction to multi-sign as the sponsor
Definition
HashPrefix.h:114
xrpl::Manifest
Definition
Manifest.h:75
Generated by
1.17.0