6 #ifndef BITCOIN_UINT256_H 7 #define BITCOIN_UINT256_H 18 template<
unsigned int BITS>
22 static constexpr
int WIDTH = BITS / 8;
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>
134 return ReadLE64(
data);
159 #endif // BITCOIN_UINT256_H
const unsigned char * begin() const
friend bool operator==(const base_blob &a, const base_blob &b)
void Serialize(Stream &s) const
int Compare(const base_blob &other) const
friend bool operator!=(const base_blob &a, const base_blob &b)
const unsigned char * end() const
uint256(const std::vector< unsigned char > &vch)
void Unserialize(Stream &s)
uint256 uint256S(const char *str)
friend bool operator<(const base_blob &a, const base_blob &b)
std::string ToString() const
unsigned int size() const
Template base class for fixed-sized opaque blobs.
static constexpr int WIDTH
std::string GetHex() const
uint160(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...
uint64_t GetUint64(int pos) const
void SetHex(const char *psz)