Raven Core  3.0.0
P2P Digital Currency
Public Member Functions | List of all members
uint256 Class Reference

256-bit opaque blob. More...

#include <uint256.h>

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

Public Member Functions

 uint256 ()
 
 uint256 (const std::vector< unsigned char > &vch)
 
int GetNibble (int index) const
 
uint64_t GetCheapHash () const
 A cheap hash function that just returns 64 bits from the result, it can be used when the contents are considered uniformly random. More...
 
- Public Member Functions inherited from base_blob< 256 >
 base_blob ()
 
 base_blob (const std::vector< unsigned char > &vch)
 
bool IsNull () const
 
void SetNull ()
 
int Compare (const base_blob &other) 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
 
uint64_t GetUint64 (int pos) const
 
void Serialize (Stream &s) const
 
void Unserialize (Stream &s)
 

Additional Inherited Members

- Protected Types inherited from base_blob< 256 >
enum  
 
- Protected Attributes inherited from base_blob< 256 >
uint8_t data [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 123 of file uint256.h.

Constructor & Destructor Documentation

◆ uint256() [1/2]

uint256::uint256 ( )
inline

Definition at line 125 of file uint256.h.

◆ uint256() [2/2]

uint256::uint256 ( const std::vector< unsigned char > &  vch)
inlineexplicit

Definition at line 126 of file uint256.h.

Member Function Documentation

◆ GetCheapHash()

uint64_t uint256::GetCheapHash ( ) const
inline

A cheap hash function that just returns 64 bits from the result, it can be used when the contents are considered uniformly random.

It is not appropriate when the value can easily be influenced from outside as e.g. a network adversary could provide values to trigger worst-case behavior.

Definition at line 140 of file uint256.h.

Here is the caller graph for this function:

◆ GetNibble()

int uint256::GetNibble ( int  index) const
inline

Definition at line 128 of file uint256.h.

Here is the caller graph for this function:

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