hdac SDK
SDK for hdac blockchain development
Public 멤버 함수 | 모든 멤버 목록
uint256 클래스 참조

#include <uint256.h>

uint256에 대한 상속 다이어그램 :
base_uint< 256 >

Public 멤버 함수

 uint256 (const base_uint< 256 > &b)
 
 uint256 (uint64_t b)
 
 uint256 (const std::string &str)
 
 uint256 (const std::vector< unsigned char > &vch)
 
uint256SetCompact (uint32_t nCompact, bool *pfNegative=NULL, bool *pfOverflow=NULL)
 
uint32_t GetCompact (bool fNegative=false) const
 
uint64_t GetHash (const uint256 &salt) const
 
- base_uint< 256 >(으)로부터 상속된 Public 멤버 함수
 base_uint (const base_uint &b)
 
 base_uint (uint64_t b)
 
 base_uint (const std::string &str)
 
 base_uint (const std::vector< unsigned char > &vch)
 
base_uintoperator= (const base_uint &b)
 
base_uintoperator= (uint64_t b)
 
bool operator! () const
 
const base_uint operator~ () const
 
const base_uint operator- () const
 
double getdouble () const
 
base_uintoperator^= (const base_uint &b)
 
base_uintoperator^= (uint64_t b)
 
base_uintoperator&= (const base_uint &b)
 
base_uintoperator|= (const base_uint &b)
 
base_uintoperator|= (uint64_t b)
 
base_uintoperator<<= (unsigned int shift)
 
base_uintoperator>>= (unsigned int shift)
 
base_uintoperator+= (const base_uint &b)
 
base_uintoperator+= (uint64_t b64)
 
base_uintoperator-= (const base_uint &b)
 
base_uintoperator-= (uint64_t b64)
 
base_uintoperator*= (uint32_t b32)
 
base_uintoperator*= (const base_uint &b)
 
base_uintoperator/= (const base_uint &b)
 
base_uintoperator++ ()
 
const base_uint operator++ (int)
 
base_uintoperator-- ()
 
const base_uint operator-- (int)
 
int CompareTo (const base_uint &b) const
 
bool EqualTo (uint64_t b) const
 
std::string GetHex () const
 
void SetHex (const char *psz)
 
void SetHex (const std::string &str)
 
std::string ToString () const
 
unsigned char * begin ()
 
const unsigned char * begin () const
 
unsigned char * end ()
 
const unsigned char * end () const
 
unsigned int size () const
 
unsigned int bits () const
 
uint64_t GetLow64 () const
 
unsigned int GetSerializeSize (int nType, int nVersion) const
 
void Serialize (Stream &s, int nType, int nVersion) const
 
void Unserialize (Stream &s, int nType, int nVersion)
 

추가로 상속된 멤버들

- base_uint< 256 >(으)로부터 상속된 Protected 타입
enum  
 
- base_uint< 256 >(으)로부터 상속된 Protected 속성
uint32_t pn [WIDTH]
 

상세한 설명

256-bit unsigned big integer.

멤버 함수 문서화

uint256 & uint256::SetCompact ( uint32_t  nCompact,
bool *  pfNegative = NULL,
bool *  pfOverflow = NULL 
)

The "compact" format is a representation of a whole number N using an unsigned 32bit number similar to a floating point format. The most significant 8 bits are the unsigned exponent of base 256. This exponent can be thought of as "number of bytes of N". The lower 23 bits are the mantissa. Bit number 24 (0x800000) represents the sign of N. N = (-1^sign) * mantissa * 256^(exponent-3)

Satoshi's original implementation used BN_bn2mpi() and BN_mpi2bn(). MPI uses the most significant bit of the first byte as sign. Thus 0x1234560000 is compact (0x05123456) and 0xc0de000000 is compact (0x0600c0de)

Bitcoin only uses this "compact" format for encoding difficulty targets, which are unsigned 256bit quantities. Thus, all the complexities of the sign bit and using base 256 are probably an implementation accident.


이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: