1#include <xrpl/basics/hardened_hash.h>
2#include <xrpl/basics/spinlock.h>
3#include <xrpl/beast/utility/Zero.h>
4#include <xrpl/beast/utility/instrumentation.h>
5#include <xrpl/protocol/AccountID.h>
6#include <xrpl/protocol/PublicKey.h>
7#include <xrpl/protocol/digest.h>
8#include <xrpl/protocol/tokens.h>
62 if (
cache_[index].encoding[0] != 0 &&
cache_[index].
id ==
id)
63 return cache_[index].encoding;
71 "ripple::detail::AccountIdCache : maximum result size");
161 static AccountID const account(beast::zero);
177 auto const account = parseBase58<AccountID>(s);
std::uint8_t const * data() const noexcept
std::size_t size() const noexcept
static std::size_t constexpr bytes
static constexpr std::size_t size()
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
Caches the base58 representations of AccountIDs.
std::string toBase58(AccountID const &id)
AccountIdCache(std::size_t count)
std::vector< CachedAccountID > cache_
std::atomic< std::uint64_t > locks_
Seed functor once per construction.
Classes to handle arrays of spinlocks packed into a single atomic integer:
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
AccountID const & noAccount()
A placeholder for empty accounts.
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
AccountID const & xrpAccount()
Compute AccountID from public key.
std::optional< AccountID > parseBase58(std::string const &s)
Parse AccountID from checked, base58 string.
static std::unique_ptr< detail::AccountIdCache > accountIdCache
bool to_issuer(AccountID &, std::string const &)
Convert hex or base58 string to AccountID.
void initAccountIdCache(std::size_t count)
Initialize the global cache used to map AccountID to base58 conversions.
std::string encodeBase58Token(TokenType type, void const *token, std::size_t size)
Encode data in Base58Check format using XRPL alphabet.
AccountID calcAccountID(PublicKey const &pk)
std::string decodeBase58Token(std::string const &s, TokenType type)
Returns the RIPEMD-160 digest of the SHA256 hash of the message.
std::array< std::uint8_t, 20 > result_type