-
-
-
62 uint64_t ctidValue{0};
-
-
-
-
-
-
-
69 if (ctidString.
length() != 16)
-
-
-
72 if (!boost::regex_match(ctidString, boost::regex(
"^[0-9A-Fa-f]+$")))
-
-
-
-
-
-
-
-
-
-
82 if ((ctidValue & 0xF000'0000'0000'0000ULL) != 0xC000'0000'0000'0000ULL)
-
-
-
85 uint32_t ledger_seq = (ctidValue >> 32) & 0xFFFF'FFFUL;
-
86 uint16_t txn_index = (ctidValue >> 16) & 0xFFFFU;
-
87 uint16_t network_id = ctidValue & 0xFFFFU;
-
88 return {{ledger_seq, txn_index, network_id}};
-
+
+
+
+
+
+
+
85 uint64_t ctidValue = 0;
+
+
+
+
+
+
+
+
93 if (ctidString.
size() != 16)
+
+
+
96 static boost::regex
const hexRegex(
"^[0-9A-Fa-f]{16}$");
+
97 if (!boost::regex_match(ctidString, hexRegex))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
114 ctidValue =
static_cast<uint64_t
>(ctid);
+
+
+
+
+
+
+
+
122 constexpr uint64_t ctidPrefixMask = 0xF000'0000'0000'0000ULL;
+
123 constexpr uint64_t ctidPrefix = 0xC000'0000'0000'0000ULL;
+
124 if ((ctidValue & ctidPrefixMask) != ctidPrefix)
+
+
+
127 uint32_t ledgerSeq =
static_cast<uint32_t
>((ctidValue >> 32) & 0x0FFF'FFFF);
+
128 uint16_t txnIndex =
static_cast<uint16_t
>((ctidValue >> 16) & 0xFFFF);
+
129 uint16_t networkID =
static_cast<uint16_t
>(ctidValue & 0xFFFF);
+
+
+
-
-
-
-
-
+
+
+
+
+
-
std::optional< std::string > encodeCTID(uint32_t ledgerSeq, uint32_t txnIndex, uint32_t networkID) noexcept
-
std::optional< std::tuple< uint32_t, uint16_t, uint16_t > > decodeCTID(T const ctid) noexcept
+
+
std::optional< std::string > encodeCTID(uint32_t ledgerSeq, uint32_t txnIndex, uint32_t networkID) noexcept
Encodes ledger sequence, transaction index, and network ID into a CTID string.
+
std::optional< std::tuple< uint32_t, uint16_t, uint16_t > > decodeCTID(T const ctid) noexcept
Decodes a CTID string or integer into its component parts.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
-
+
diff --git a/NetworkOPs_8cpp_source.html b/NetworkOPs_8cpp_source.html
index b79e140e96..41e773b16a 100644
--- a/NetworkOPs_8cpp_source.html
+++ b/NetworkOPs_8cpp_source.html
@@ -5519,7 +5519,7 @@ $(document).ready(function() { init_codefold(0); });
void rngfill(void *const buffer, std::size_t const bytes, Generator &g)
std::string const & getVersionString()
Server version.
-
std::optional< std::string > encodeCTID(uint32_t ledgerSeq, uint32_t txnIndex, uint32_t networkID) noexcept
+
std::optional< std::string > encodeCTID(uint32_t ledgerSeq, uint32_t txnIndex, uint32_t networkID) noexcept
Encodes ledger sequence, transaction index, and network ID into a CTID string.
Json::Value computeBookChanges(std::shared_ptr< L const > const &lpAccepted)
void insertNFTSyntheticInJson(Json::Value &, std::shared_ptr< STTx const > const &, TxMeta const &)
Adds common synthetic fields to transaction-related JSON responses.
void insertMPTokenIssuanceID(Json::Value &response, std::shared_ptr< STTx const > const &transaction, TxMeta const &transactionMeta)
diff --git a/Transaction_8cpp_source.html b/Transaction_8cpp_source.html
index 3567c8aafb..d53bff65ca 100644
--- a/Transaction_8cpp_source.html
+++ b/Transaction_8cpp_source.html
@@ -325,7 +325,7 @@ $(document).ready(function() { init_codefold(0); });
-
std::optional< std::string > encodeCTID(uint32_t ledgerSeq, uint32_t txnIndex, uint32_t networkID) noexcept
+
std::optional< std::string > encodeCTID(uint32_t ledgerSeq, uint32_t txnIndex, uint32_t networkID) noexcept
Encodes ledger sequence, transaction index, and network ID into a CTID string.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
diff --git a/Transaction__test_8cpp_source.html b/Transaction__test_8cpp_source.html
index fbb515ca0a..33337cfcc0 100644
--- a/Transaction__test_8cpp_source.html
+++ b/Transaction__test_8cpp_source.html
@@ -1094,9 +1094,9 @@ $(document).ready(function() { init_codefold(0); });
@ objectValue
object value (collection of name/value pairs).
-
std::optional< std::string > encodeCTID(uint32_t ledgerSeq, uint32_t txnIndex, uint32_t networkID) noexcept
+
std::optional< std::string > encodeCTID(uint32_t ledgerSeq, uint32_t txnIndex, uint32_t networkID) noexcept
Encodes ledger sequence, transaction index, and network ID into a CTID string.
ErrorInfo const & get_error_info(error_code_i code)
Returns an ErrorInfo that reflects the error code.
-
std::optional< std::tuple< uint32_t, uint16_t, uint16_t > > decodeCTID(T const ctid) noexcept
+
std::optional< std::tuple< uint32_t, uint16_t, uint16_t > > decodeCTID(T const ctid) noexcept
Decodes a CTID string or integer into its component parts.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
diff --git a/Tx_8cpp_source.html b/Tx_8cpp_source.html
index 12b1cf5ba6..48b196e0d7 100644
--- a/Tx_8cpp_source.html
+++ b/Tx_8cpp_source.html
@@ -470,12 +470,12 @@ $(document).ready(function() { init_codefold(0); });
@ objectValue
object value (collection of name/value pairs).
-
std::optional< std::string > encodeCTID(uint32_t ledgerSeq, uint32_t txnIndex, uint32_t networkID) noexcept
+
std::optional< std::string > encodeCTID(uint32_t ledgerSeq, uint32_t txnIndex, uint32_t networkID) noexcept
Encodes ledger sequence, transaction index, and network ID into a CTID string.
Json::Value make_error(error_code_i code)
Returns a new json object that reflects the error code.
void insertNFTSyntheticInJson(Json::Value &, std::shared_ptr< STTx const > const &, TxMeta const &)
Adds common synthetic fields to transaction-related JSON responses.
void insertMPTokenIssuanceID(Json::Value &response, std::shared_ptr< STTx const > const &transaction, TxMeta const &transactionMeta)
void insertDeliverMax(Json::Value &tx_json, TxType txnType, unsigned int apiVersion)
Copy Amount field to DeliverMax field in transaction output JSON.
-
std::optional< std::tuple< uint32_t, uint16_t, uint16_t > > decodeCTID(T const ctid) noexcept
+
std::optional< std::tuple< uint32_t, uint16_t, uint16_t > > decodeCTID(T const ctid) noexcept
Decodes a CTID string or integer into its component parts.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
diff --git a/namespaceripple_1_1RPC.html b/namespaceripple_1_1RPC.html
index f087ff17ff..ae1e4df73d 100644
--- a/namespaceripple_1_1RPC.html
+++ b/namespaceripple_1_1RPC.html
@@ -187,9 +187,11 @@ Functions
| Json::Value | computeBookChanges (std::shared_ptr< L const > const &lpAccepted) |
| |
| std::optional< std::string > | encodeCTID (uint32_t ledgerSeq, uint32_t txnIndex, uint32_t networkID) noexcept |
+
| | Encodes ledger sequence, transaction index, and network ID into a CTID string.
|
| |
| template<typename T > |
| std::optional< std::tuple< uint32_t, uint16_t, uint16_t > > | decodeCTID (T const ctid) noexcept |
+
| | Decodes a CTID string or integer into its component parts.
|
| |
| template<class GetLedgerIndex , class GetCloseTime > |
| std::optional< STAmount > | getDeliveredAmount (GetLedgerIndex const &getLedgerIndex, GetCloseTime const &getCloseTime, std::shared_ptr< STTx const > const &serializedTx, TxMeta const &transactionMeta) |
@@ -1451,7 +1453,18 @@ template<class L >