19 const std::string random_encoded_string(buffer.begin(), buffer.end());
21 std::vector<unsigned char> decoded;
23 const std::string encoded_string =
EncodeBase58(decoded);
36 const std::string encoded_string =
EncodeBase32(*result);
43 const std::string encoded_string =
EncodeBase64(*result);
std::string EncodeBase58(Span< const unsigned char > input)
Why base-58 instead of standard base-64 encoding?
std::string EncodeBase58Check(Span< const unsigned char > input)
Encode a byte span into a base58-encoded string, including checksum.
static bool DecodeBase58Check(const char *psz, std::vector< unsigned char > &vchRet, int max_ret_len)
static bool DecodeBase58(const char *psz, std::vector< unsigned char > &vch, int max_ret_len)
FUZZ_TARGET(base_encode_decode)
bool error(const char *fmt, const Args &... args)
bool DecodeBase64PSBT(PartiallySignedTransaction &psbt, const std::string &base64_tx, std::string &error)
Decode a base64ed PSBT into a PartiallySignedTransaction.
std::string TrimString(std::string_view str, std::string_view pattern=" \f\n\r\t\v")
std::string_view TrimStringView(std::string_view str, std::string_view pattern=" \f\n\r\t\v")
A version of CTransaction with the PSBT format.
std::string EncodeBase64(Span< const unsigned char > input)
std::string EncodeBase32(Span< const unsigned char > input, bool pad)
Base32 encode.
std::optional< std::vector< unsigned char > > DecodeBase64(std::string_view str)
std::string ToLower(std::string_view str)
Returns the lowercase equivalent of the given string.
std::optional< std::vector< unsigned char > > DecodeBase32(std::string_view str)