plebble
us::gov::crypto::b58 Namespace Reference

Functions

std::string decode_string (const std::string &s)
 
std::vector< unsigned char > decode (const std::string &s)
 
std::string encode (const std::string &s)
 
constexpr bool is_space (char c) noexcept
 
bool decode (const char *psz, std::vector< unsigned char > &vch)
 
bool decode (const char *psz, std::array< unsigned char, 32 > &vch)
 
std::string encode (const unsigned char *pbegin, const unsigned char *pend)
 
std::string encode (const std::vector< unsigned char > &vch)
 
bool decode (const std::string &str, std::vector< unsigned char > &vchRet)
 

Variables

static const char * pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
 
static const int8_t mapBase58 [256]
 

Function Documentation

◆ decode() [1/4]

bool us::gov::crypto::b58::decode ( const char *  psz,
std::array< unsigned char, 32 > &  vch 
)

References is_space(), mapBase58, and unlikely.

Here is the call graph for this function:

◆ decode() [2/4]

bool us::gov::crypto::b58::decode ( const char *  psz,
std::vector< unsigned char > &  vch 
)

References is_space(), mapBase58, and unlikely.

Here is the call graph for this function:

◆ decode() [3/4]

std::vector< unsigned char > us::gov::crypto::b58::decode ( const std::string &  s)

Referenced by decode(), decode_string(), and us::gov::crypto::ec::keys::pub_t::read_b58().

Here is the caller graph for this function:

◆ decode() [4/4]

bool us::gov::crypto::b58::decode ( const std::string &  str,
std::vector< unsigned char > &  vchRet 
)

Decode a base58-encoded string (str) into a byte vector (vchRet). return true if decoding is successful.

References decode().

Here is the call graph for this function:

◆ decode_string()

std::string us::gov::crypto::b58::decode_string ( const std::string &  )

Decode a base58-encoded string (psz) into a byte vector (vchRet). return true if decoding is successful. psz cannot be NULL.

References decode().

Here is the call graph for this function:

◆ encode() [1/3]

std::string us::gov::crypto::b58::encode ( const std::string &  )

Encode a byte sequence as a base58-encoded string. pbegin and pend cannot be NULL, unless both are.

Referenced by encode(), and us::gov::crypto::ec::keys::pub_t::to_b58().

Here is the caller graph for this function:

◆ encode() [2/3]

std::string us::gov::crypto::b58::encode ( const std::vector< unsigned char > &  vch)

Encode a byte vector as a base58-encoded string

References encode().

Here is the call graph for this function:

◆ encode() [3/3]

std::string us::gov::crypto::b58::encode ( const unsigned char *  pbegin,
const unsigned char *  pend 
)

References pszBase58.

◆ is_space()

constexpr bool us::gov::crypto::b58::is_space ( char  c)
inlineconstexprnoexcept

Referenced by decode().

Here is the caller graph for this function:

Variable Documentation

◆ mapBase58

const int8_t us::gov::crypto::b58::mapBase58[256]
static
Initial value:
= {
-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8,-1,-1,-1,-1,-1,-1,
-1, 9,10,11,12,13,14,15, 16,-1,17,18,19,20,21,-1,
22,23,24,25,26,27,28,29, 30,31,32,-1,-1,-1,-1,-1,
-1,33,34,35,36,37,38,39, 40,41,42,43,-1,44,45,46,
47,48,49,50,51,52,53,54, 55,56,57,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,
}

Referenced by decode().

◆ pszBase58

const char* us::gov::crypto::b58::pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
static

Referenced by encode().