Equity
Bitcoin Protocol Library
Classes | Functions
Utility Namespace Reference

Classes

class  MerkleTree
 

Functions

uint16_t swapEndian (uint16_t x)
 
uint32_t swapEndian (uint32_t x)
 
uint64_t swapEndian (uint64_t x)
 
uint8_t littleEndian (uint8_t x)
 
uint16_t littleEndian (uint16_t x)
 
uint32_t littleEndian (uint32_t x)
 
uint64_t littleEndian (uint64_t x)
 
uint8_t bigEndian (uint8_t x)
 
uint16_t bigEndian (uint16_t x)
 
uint32_t bigEndian (uint32_t x)
 
uint64_t bigEndian (uint64_t x)
 
std::string toHex (std::vector< uint8_t > const &v)
 Converts a vector to a hex string. More...
 
std::string toHex (uint8_t const *v, size_t length)
 Converts a vector to a hex string. More...
 
std::vector< uint8_t > fromHex (std::string const &x)
 Converts a hex string to a vector. More...
 
std::vector< uint8_t > fromHex (char const *x, size_t length)
 Converts a hex string to a vector. More...
 
std::string toHexR (std::vector< uint8_t > const &v)
 Converts a vector to a hex string, reversing the order of the bytes. More...
 
std::string toHexR (uint8_t const *v, size_t length)
 Converts a vector to a hex string, reversing the order of the bytes. More...
 
std::vector< uint8_t > fromHexR (std::string const &x)
 Converts a hex string to a vector, reversing the order of the bytes. More...
 
std::vector< uint8_t > fromHexR (char const *x, size_t length)
 Converts a hex string to a vector, reversing the order of the bytes. More...
 
template<>
std::string toJson< uint8_t > (std::vector< uint8_t > const &v)
 
template<>
std::string toJson< uint8_t > (uint8_t const *a, size_t size)
 Converts a vector of bytes to a hex JSON string value. More...
 
std::vector< uint8_t > fromJson (std::string const &j)
 Converts a hex JSON string value to a vector. More...
 
std::string shorten (std::string const &in, size_t size)
 
template<size_t N>
std::string toHex (std::array< uint8_t, N > const &a)
 Converts an std::array to a hex string. More...
 
template<size_t N>
std::string toHexR (std::array< uint8_t, N > const &a)
 Converts a vector to a hex string, reversing the order of the bytes. More...
 
template<typename T >
std::string toJson (std::vector< T > const &v)
 Converts a generic vector to a JSON array value. More...
 
template<typename T , size_t N>
std::string toJson (std::array< T, N > const &a)
 Converts a generic std::array to a JSON array value. More...
 
template<typename T >
std::string toJson (T const *values, size_t size)
 Converts a generic array to a JSON array value. More...
 

Function Documentation

uint8_t Utility::bigEndian ( uint8_t  x)
inline
uint16_t Utility::bigEndian ( uint16_t  x)
inline
uint32_t Utility::bigEndian ( uint32_t  x)
inline
uint64_t Utility::bigEndian ( uint64_t  x)
inline
std::vector< uint8_t > Utility::fromHex ( std::string const &  x)

Converts a hex string to a vector.

std::vector< uint8_t > Utility::fromHex ( char const *  x,
size_t  length 
)

Converts a hex string to a vector.

std::vector< uint8_t > Utility::fromHexR ( std::string const &  x)

Converts a hex string to a vector, reversing the order of the bytes.

std::vector< uint8_t > Utility::fromHexR ( char const *  x,
size_t  length 
)

Converts a hex string to a vector, reversing the order of the bytes.

std::vector< uint8_t > Utility::fromJson ( std::string const &  j)

Converts a hex JSON string value to a vector.

uint8_t Utility::littleEndian ( uint8_t  x)
inline
uint16_t Utility::littleEndian ( uint16_t  x)
inline
uint32_t Utility::littleEndian ( uint32_t  x)
inline
uint64_t Utility::littleEndian ( uint64_t  x)
inline
std::string Utility::shorten ( std::string const &  in,
size_t  size 
)
uint16_t Utility::swapEndian ( uint16_t  x)
inline
uint32_t Utility::swapEndian ( uint32_t  x)
inline
uint64_t Utility::swapEndian ( uint64_t  x)
inline
template<size_t N>
std::string Utility::toHex ( std::array< uint8_t, N > const &  a)

Converts an std::array to a hex string.

std::string Utility::toHex ( std::vector< uint8_t > const &  v)

Converts a vector to a hex string.

std::string Utility::toHex ( uint8_t const *  v,
size_t  length 
)

Converts a vector to a hex string.

template<size_t N>
std::string Utility::toHexR ( std::array< uint8_t, N > const &  a)

Converts a vector to a hex string, reversing the order of the bytes.

std::string Utility::toHexR ( std::vector< uint8_t > const &  v)

Converts a vector to a hex string, reversing the order of the bytes.

std::string Utility::toHexR ( uint8_t const *  v,
size_t  length 
)

Converts a vector to a hex string, reversing the order of the bytes.

template<typename T >
std::string Utility::toJson ( std::vector< T > const &  v)

Converts a generic vector to a JSON array value.

template<typename T , size_t N>
std::string Utility::toJson ( std::array< T, N > const &  a)

Converts a generic std::array to a JSON array value.

template<typename T >
std::string Utility::toJson ( T const *  values,
size_t  size 
)

Converts a generic array to a JSON array value.

template<>
std::string Utility::toJson< uint8_t > ( std::vector< uint8_t > const &  v)
template<>
std::string Utility::toJson< uint8_t > ( uint8_t const *  a,
size_t  size 
)

Converts a vector of bytes to a hex JSON string value.