Bitcoin
Typedefs | Functions | Variables
anonymous_namespace{bech32.cpp} Namespace Reference

Typedefs

typedef std::vector< uint8_tdata
 

Functions

data Cat (data x, const data &y)
 
uint32_t PolyMod (const data &v)
 
unsigned char LowerCase (unsigned char c)
 
data ExpandHRP (const std::string &hrp)
 
bool VerifyChecksum (const std::string &hrp, const data &values)
 
data CreateChecksum (const std::string &hrp, const data &values)
 

Variables

const char * CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"
 
const int8_t CHARSET_REV [128]
 

Typedef Documentation

◆ data

typedef std::vector<uint8_t> anonymous_namespace{bech32.cpp}::data

Function Documentation

◆ Cat()

data anonymous_namespace{bech32.cpp}::Cat ( data  x,
const data y 
)

Concatenate two byte arrays.

◆ CreateChecksum()

data anonymous_namespace{bech32.cpp}::CreateChecksum ( const std::string &  hrp,
const data values 
)

Create a checksum.

◆ ExpandHRP()

data anonymous_namespace{bech32.cpp}::ExpandHRP ( const std::string &  hrp)

Expand a HRP for use in checksum computation.

◆ LowerCase()

unsigned char anonymous_namespace{bech32.cpp}::LowerCase ( unsigned char  c)
inline

Convert to lower case.

◆ PolyMod()

uint32_t anonymous_namespace{bech32.cpp}::PolyMod ( const data v)

This function will compute what 6 5-bit values to XOR into the last 6 input values, in order to make the checksum 0. These 6 values are packed together in a single 30-bit integer. The higher bits correspond to earlier values.

◆ VerifyChecksum()

bool anonymous_namespace{bech32.cpp}::VerifyChecksum ( const std::string &  hrp,
const data values 
)

Verify a checksum.

Variable Documentation

◆ CHARSET

const char* anonymous_namespace{bech32.cpp}::CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"

The Bech32 character set for encoding.

◆ CHARSET_REV

const int8_t anonymous_namespace{bech32.cpp}::CHARSET_REV[128]
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,
15, -1, 10, 17, 21, 20, 26, 30, 7, 5, -1, -1, -1, -1, -1, -1,
-1, 29, -1, 24, 13, 25, 9, 8, 23, -1, 18, 22, 31, 27, 19, -1,
1, 0, 3, 16, 11, 28, 12, 14, 6, 4, 2, -1, -1, -1, -1, -1,
-1, 29, -1, 24, 13, 25, 9, 8, 23, -1, 18, 22, 31, 27, 19, -1,
1, 0, 3, 16, 11, 28, 12, 14, 6, 4, 2, -1, -1, -1, -1, -1
}

The Bech32 character set for decoding.