6 #ifndef BITCOIN_UINT256_H
7 #define BITCOIN_UINT256_H
18 template<
unsigned int BITS>
30 explicit base_blob(
const std::vector<unsigned char>& vch);
34 for (
int i = 0; i <
WIDTH; i++)
51 std::string
GetHex()
const;
52 void SetHex(
const char* psz);
53 void SetHex(
const std::string& str);
66 const unsigned char*
begin()
const
71 const unsigned char*
end()
const
83 const uint8_t* ptr =
data + pos * 8;
84 return ((uint64_t)ptr[0]) | \
85 ((uint64_t)ptr[1]) << 8 | \
86 ((uint64_t)ptr[2]) << 16 | \
87 ((uint64_t)ptr[3]) << 24 | \
88 ((uint64_t)ptr[4]) << 32 | \
89 ((uint64_t)ptr[5]) << 40 | \
90 ((uint64_t)ptr[6]) << 48 | \
91 ((uint64_t)ptr[7]) << 56;
94 template<
typename Stream>
100 template<
typename Stream>
136 return ReadLE64(
data);
Template base class for fixed-sized opaque blobs.
unsigned int size() const
void SetHex(const char *psz)
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)
uint160(const std::vector< unsigned char > &vch)
uint160(const base_blob< 160 > &b)
uint256(const base_blob< 256 > &b)
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...
uint256 uint256S(const char *str)