Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
uint256 Class Reference

256-bit opaque blob. More...

#include <uint256.h>

Inheritance diagram for uint256:
[legend]
Collaboration diagram for uint256:
[legend]

Public Member Functions

constexpr uint256 ()=default
consteval uint256 (std::string_view hex_str)
constexpr uint256 (uint8_t v)
constexpr uint256 (std::span< const unsigned char > vch)
Public Member Functions inherited from base_blob< 256 >
constexpr base_blob ()
constexpr bool IsNull () const
constexpr void SetNull ()
constexpr int Compare (const base_blob &other) const
 Lexicographic ordering.
constexpr const unsigned char * data () const
constexpr unsigned char * begin ()
constexpr unsigned char * end ()
constexpr uint64_t GetUint64 (int pos) const
void Serialize (Stream &s) const
void Unserialize (Stream &s)
std::string GetHex () const
std::string ToString () const

Static Public Member Functions

static std::optional< uint256FromHex (std::string_view str)
static std::optional< uint256FromUserHex (std::string_view str)
Static Public Member Functions inherited from base_blob< 256 >
static constexpr unsigned int size ()

Static Public Attributes

static const uint256 ZERO
static const uint256 ONE

Additional Inherited Members

Protected Attributes inherited from base_blob< 256 >
std::array< uint8_t, WIDTHm_data
Static Protected Attributes inherited from base_blob< 256 >
static constexpr int WIDTH

Detailed Description

256-bit opaque blob.

Note
This type is called uint256 for historical reasons only. It is an opaque blob of 256 bits and has no integer operations. Use arith_uint256 if those are required.

Definition at line 195 of file uint256.h.

Constructor & Destructor Documentation

◆ uint256() [1/4]

uint256::uint256 ( )
constexprdefault

◆ uint256() [2/4]

uint256::uint256 ( std::string_view hex_str)
inlineexplicitconsteval

Definition at line 200 of file uint256.h.

Here is the call graph for this function:

◆ uint256() [3/4]

uint256::uint256 ( uint8_t v)
inlineexplicitconstexpr

Definition at line 201 of file uint256.h.

Here is the call graph for this function:

◆ uint256() [4/4]

uint256::uint256 ( std::span< const unsigned char > vch)
inlineexplicitconstexpr

Definition at line 202 of file uint256.h.

Here is the call graph for this function:

Member Function Documentation

◆ FromHex()

std::optional< uint256 > uint256::FromHex ( std::string_view str)
inlinestatic

Definition at line 197 of file uint256.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromUserHex()

std::optional< uint256 > uint256::FromUserHex ( std::string_view str)
inlinestatic

Definition at line 198 of file uint256.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ONE

const uint256 uint256::ONE
static

Definition at line 204 of file uint256.h.

◆ ZERO

const uint256 uint256::ZERO
static

Definition at line 203 of file uint256.h.


The documentation for this class was generated from the following files: