20 #include <ripple/basics/hardened_hash.h>
21 #include <ripple/basics/spinlock.h>
22 #include <ripple/protocol/AccountID.h>
23 #include <ripple/protocol/PublicKey.h>
24 #include <ripple/protocol/digest.h>
25 #include <ripple/protocol/tokens.h>
73 if (
cache_[index].encoding[0] != 0 &&
cache_[index].
id ==
id)
74 return cache_[index].encoding;
80 assert(ret.size() <= 38);
170 static AccountID const account(beast::zero);
186 auto const account = parseBase58<AccountID>(s);
std::uint8_t const * data() const noexcept
AccountIdCache(std::size_t count)
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
std::string decodeBase58Token(std::string const &s, TokenType type)
Decode a token of given type encoded using Base58Check and the XRPL alphabet.
constexpr static std::size_t size()
Caches the base58 representations of AccountIDs.
static constexpr std::size_t bytes
Returns the RIPEMD-160 digest of the SHA256 hash of the message.
Classes to handle arrays of spinlocks packed into a single atomic integer:
std::size_t size() const noexcept
std::string toBase58(AccountID const &id)
AccountID calcAccountID(PublicKey const &pk)
std::atomic< std::uint64_t > locks_
AccountID const & xrpAccount()
Compute AccountID from public key.
Seed functor once per construction.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
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.
std::vector< CachedAccountID > cache_
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
static std::unique_ptr< detail::AccountIdCache > accountIdCache
std::optional< AccountID > parseBase58(std::string const &s)
Parse AccountID from checked, base58 string.
AccountID const & noAccount()
A placeholder for empty accounts.
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
bool to_issuer(AccountID &, std::string const &)
Convert hex or base58 string to AccountID.