21 template<
unsigned int BITS>
25 static constexpr
int WIDTH = BITS / 8;
34 explicit base_blob(
const std::vector<unsigned char>& vch);
38 for (
int i = 0; i <
WIDTH; i++)
55 std::string
GetHex()
const;
56 void SetHex(
const char* psz);
57 void SetHex(
const std::string& str);
73 const unsigned char*
begin()
const
78 const unsigned char*
end()
const
90 const uint8_t* ptr =
m_data + pos * 8;
91 return ((uint64_t)ptr[0]) | \
92 ((uint64_t)ptr[1]) << 8 | \
93 ((uint64_t)ptr[2]) << 16 | \
94 ((uint64_t)ptr[3]) << 24 | \
95 ((uint64_t)ptr[4]) << 32 | \
96 ((uint64_t)ptr[5]) << 40 | \
97 ((uint64_t)ptr[6]) << 48 | \
98 ((uint64_t)ptr[7]) << 56;
101 template<
typename Stream>
107 template<
typename Stream>
Template base class for fixed-sized opaque blobs.
unsigned int size() const
constexpr base_blob(uint8_t v)
static constexpr int WIDTH
void SetHex(const char *psz)
const unsigned char * data() const
void Unserialize(Stream &s)
int Compare(const base_blob &other) const
const unsigned char * begin() const
std::string ToString() const
friend bool operator!=(const base_blob &a, const base_blob &b)
friend bool operator==(const base_blob &a, const base_blob &b)
void Serialize(Stream &s) const
std::string GetHex() const
const unsigned char * end() const
uint64_t GetUint64(int pos) const
friend bool operator<(const base_blob &a, const base_blob &b)
blob88(const std::vector< unsigned char > &vch)
blob88(const base_blob< 88 > &b)
uint160(const std::vector< unsigned char > &vch)
uint256(const std::vector< unsigned char > &vch)
uint64_t GetCheapHash() const
A cheap hash function that just returns 64 bits from the result, it can be used when the contents are...
uint512(const std::vector< unsigned char > &vch)
uint512(const base_blob< 512 > &b)
std::size_t operator()(const uint256 &k) const
const uint256 UINT256_MAX
const uint256 UINT256_ZERO
constant uint256 instances
uint256 uint256S(const char *str)
uint512 uint512S(const char *str)
const uint256 UINT256_ONE