Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

common.h File Reference
#include <stdint.h>
#include <string.h>
#include <compat/endian.h>
+ Include dependency graph for common.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static uint16_t ReadLE16 (const unsigned char *ptr)
 
static uint32_t ReadLE32 (const unsigned char *ptr)
 
static uint64_t ReadLE64 (const unsigned char *ptr)
 
static void WriteLE16 (unsigned char *ptr, uint16_t x)
 
static void WriteLE32 (unsigned char *ptr, uint32_t x)
 
static void WriteLE64 (unsigned char *ptr, uint64_t x)
 
static uint32_t ReadBE32 (const unsigned char *ptr)
 
static uint64_t ReadBE64 (const unsigned char *ptr)
 
static void WriteBE32 (unsigned char *ptr, uint32_t x)
 
static void WriteBE64 (unsigned char *ptr, uint64_t x)
 
static uint64_t CountBits (uint64_t x)
 Return the smallest number n such that (x >> n) == 0 (or 64 if the highest bit in x is set. More...
 

Function Documentation

◆ CountBits()

static uint64_t CountBits ( uint64_t  x)
inlinestatic

Return the smallest number n such that (x >> n) == 0 (or 64 if the highest bit in x is set.

Definition at line 83 of file common.h.

Referenced by FastRandomContext::randrange().

◆ ReadBE32()

static uint32_t ReadBE32 ( const unsigned char *  ptr)
inlinestatic

Definition at line 56 of file common.h.

References be32toh(), and memcpy().

◆ ReadBE64()

static uint64_t ReadBE64 ( const unsigned char *  ptr)
inlinestatic

Definition at line 63 of file common.h.

References be64toh(), and memcpy().

◆ ReadLE16()

static uint16_t ReadLE16 ( const unsigned char *  ptr)
inlinestatic

Definition at line 17 of file common.h.

References le16toh(), and memcpy().

Referenced by CScript::GetOp2().

◆ ReadLE32()

static uint32_t ReadLE32 ( const unsigned char *  ptr)
inlinestatic

◆ ReadLE64()

static uint64_t ReadLE64 ( const unsigned char *  ptr)
inlinestatic

Definition at line 31 of file common.h.

References le64toh(), and memcpy().

Referenced by uint256::GetCheapHash(), and FastRandomContext::rand64().

◆ WriteBE32()

static void WriteBE32 ( unsigned char *  ptr,
uint32_t  x 
)
inlinestatic

Definition at line 70 of file common.h.

References htobe32(), and memcpy().

Referenced by CSHA1::Finalize(), and CSHA256::Finalize().

◆ WriteBE64()

static void WriteBE64 ( unsigned char *  ptr,
uint64_t  x 
)
inlinestatic

Definition at line 76 of file common.h.

References htobe64(), and memcpy().

Referenced by CSHA1::Finalize(), CSHA512::Finalize(), and CSHA256::Finalize().

◆ WriteLE16()

static void WriteLE16 ( unsigned char *  ptr,
uint16_t  x 
)
inlinestatic

Definition at line 38 of file common.h.

References htole16(), and memcpy().

Referenced by CScript::operator<<().

◆ WriteLE32()

static void WriteLE32 ( unsigned char *  ptr,
uint32_t  x 
)
inlinestatic

◆ WriteLE64()

static void WriteLE64 ( unsigned char *  ptr,
uint64_t  x 
)
inlinestatic

Definition at line 50 of file common.h.

References htole64(), and memcpy().

Referenced by CRIPEMD160::Finalize(), and GetHWRand().

Released under the MIT license