 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
6 #ifndef BITCOIN_UINT256_H
7 #define BITCOIN_UINT256_H
18 template<
unsigned int BITS>
22 static constexpr
int WIDTH = BITS / 8;
31 explicit base_blob(
const std::vector<unsigned char>& vch);
35 for (
int i = 0; i <
WIDTH; i++)
52 std::string
GetHex()
const;
53 void SetHex(
const char* psz);
54 void SetHex(
const std::string& str);
70 const unsigned char*
begin()
const
75 const unsigned char*
end()
const
80 static constexpr
unsigned int size()
87 const uint8_t* ptr =
m_data + pos * 8;
88 return ((uint64_t)ptr[0]) | \
89 ((uint64_t)ptr[1]) << 8 | \
90 ((uint64_t)ptr[2]) << 16 | \
91 ((uint64_t)ptr[3]) << 24 | \
92 ((uint64_t)ptr[4]) << 32 | \
93 ((uint64_t)ptr[5]) << 40 | \
94 ((uint64_t)ptr[6]) << 48 | \
95 ((uint64_t)ptr[7]) << 56;
98 template<
typename Stream>
104 template<
typename Stream>
156 #endif // BITCOIN_UINT256_H
Span< const std::byte > MakeByteSpan(V &&v) noexcept
void Serialize(Stream &s) const
uint160(const std::vector< unsigned char > &vch)
static constexpr int WIDTH
friend bool operator!=(const base_blob &a, const base_blob &b)
const unsigned char * data() const
uint64_t GetUint64(int pos) const
static constexpr unsigned int size()
Template base class for fixed-sized opaque blobs.
constexpr base_blob(uint8_t v)
int Compare(const base_blob &other) const
void Unserialize(Stream &s)
std::string GetHex() const
friend bool operator<(const base_blob &a, const base_blob &b)
friend bool operator==(const base_blob &a, const base_blob &b)
static const uint256 ZERO
std::string ToString() const
uint256 uint256S(const char *str)
constexpr uint256(uint8_t v)
const unsigned char * end() const
uint256(const std::vector< unsigned char > &vch)
const unsigned char * begin() const
Span< std::byte > MakeWritableByteSpan(V &&v) noexcept
void SetHex(const char *psz)