Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cHashCode Class Reference

#include <cHashCode.h>

Inheritance diagram for GrayLib::cHashCode:
Gray::cHeapBlock Gray::cMemBlock

Public Member Functions

 cHashCode () noexcept
 
 cHashCode (size_t nSize)
 
 cHashCode (const void *p, size_t nSize)
 
 cHashCode (const SUPER_t &h1)
 
 ~cHashCode ()
 
bool isValidHash () const noexcept
 
size_t get_HashSize () const noexcept
 
bool isMatch (const SUPER_t &match) const
 
BYTE * SetRawDigest (const BYTE *pData, size_t nSize)
 
BYTE * put_RawDigest (const SUPER_t &m)
 
BYTE * ref_RawDigest ()
 
void SetErase ()
 
THIS_toperator= (const THIS_t &h1)
 
StrLen_t get_HexSize () const
 
StrLen_t GetHexDigest (OUT char *pszHexString) const
 
cStringA get_HexDigest () const
 
bool isMatchHexDigest (const char *pszHexStr) const
 
HRESULT put_HexDigest (const char *pszInp)
 
- Public Member Functions inherited from Gray::cHeapBlock
 cHeapBlock () noexcept
 
 cHeapBlock (const THIS_t &ref)
 
 cHeapBlock (THIS_t &&ref) noexcept
 
 cHeapBlock (size_t nSize)
 
 cHeapBlock (const void *pDataCopy, size_t nSize)
 
 ~cHeapBlock ()
 
THIS_toperator= (const THIS_t &ref)
 
THIS_toperator= (THIS_t &&ref)
 
bool isValidRead () const noexcept
 
bool isCorrupt () const noexcept
 
size_t get_AllocSize () const
 
size_t GetHeapStats (OUT ITERATE_t &iAllocCount) const
 
void Free ()
 
void FreeSecure ()
 
void SetHeapBlock (void *pData, size_t nSize)
 
void DetachHeapBlock ()
 
bool Alloc (size_t nSize)
 
bool Alloc (const void *pData, size_t nSize)
 
bool ReAlloc (size_t nSize)
 
bool ReAlloc (const void *pData, size_t nSize)
 
bool ReAllocLazy (size_t iSizeNew)
 
bool SetCopy (const cHeapBlock &rSrc)
 
void * get_Data () const noexcept
 
BYTE * get_DataBytes () const noexcept
 
char * get_DataA () const noexcept
 
wchar_t * get_DataW () const noexcept
 
 operator void * () const noexcept
 
 operator BYTE * () const noexcept
 
 operator char * () const noexcept
 
- Public Member Functions inherited from Gray::cMemBlock
 cMemBlock () noexcept
 
 cMemBlock (const void *pData, size_t nSize) noexcept
 
 cMemBlock (const cMemBlock &block) noexcept
 
 cMemBlock (const cMemBlock *pBlock) noexcept
 
size_t get_DataSize () const noexcept
 
void * get_Data () const noexcept
 
BYTE * get_DataBytes () const noexcept
 
char * get_DataA () const noexcept
 
 operator const BYTE * () const noexcept
 
bool isValidPtr () const noexcept
 
bool IsValidIndex (size_t i) const noexcept
 
bool IsValidIndex2 (size_t i) const noexcept
 
bool IsValidPtr (const void *p) const noexcept
 
bool IsValidPtr2 (const void *p) const noexcept
 
bool IsZeros () const noexcept
 
bool IsEqualData (const void *pData, size_t nSize) const noexcept
 
bool IsEqualData (const cMemBlock *pData) const noexcept
 
bool IsEqualData (const cMemBlock &data) const noexcept
 
BYTE * GetOffset (size_t nOffset) const
 
const void * get_DataEnd () const noexcept
 
void put_DataPtr (void *pStart) noexcept
 
void put_Size (size_t nSize) noexcept
 
void SetBlock (void *pData, size_t nSize) noexcept
 
void SetEmptyBlock () noexcept
 
void InitZeros () noexcept
 
StrLen_t ConvertToString (char *pszDst, StrLen_t iDstSizeMax) const
 

Additional Inherited Members

- Static Public Member Functions inherited from Gray::cMemBlock
static COMPARE_t __stdcall Compare (const void *pData1, size_t iLen1, const void *pData2, size_t iLen2)
 
- Protected Attributes inherited from Gray::cMemBlock
size_t m_nSize
 size_t of m_pData in bytes. May be determined at runtime. More...
 
void * m_pData
 

Detailed Description

A generic hash digest code container for any type of hash. (any size) Size varies depending on the type of hash. Similar to _WIN32 cCipherHash and cCipherKey

Constructor & Destructor Documentation

◆ cHashCode() [1/4]

GrayLib::cHashCode::cHashCode ( )
inlinenoexcept

◆ cHashCode() [2/4]

GrayLib::cHashCode::cHashCode ( size_t  nSize)
inline

◆ cHashCode() [3/4]

GrayLib::cHashCode::cHashCode ( const void *  p,
size_t  nSize 
)
inline

◆ cHashCode() [4/4]

GrayLib::cHashCode::cHashCode ( const SUPER_t h1)
inline

◆ ~cHashCode()

GrayLib::cHashCode::~cHashCode ( )
inline

Clear for security purposes

Member Function Documentation

◆ get_HashSize()

size_t GrayLib::cHashCode::get_HashSize ( ) const
inlinenoexcept

like get_DataLength but 0 if all zeros.

◆ get_HexDigest()

cStringA GrayLib::cHashCode::get_HexDigest ( ) const
inline

Get a text string of hex chars that represents the hash code. cHashMD5::SizeRawDigest

◆ get_HexSize()

StrLen_t GrayLib::cHashCode::get_HexSize ( ) const
inline

Get the required size of the string.

◆ GetHexDigest()

StrLen_t GrayLib::cHashCode::GetHexDigest ( OUT char *  pszHexString) const
inline

ASSUME pszHexString is big enough. get_HexSize()

◆ isMatch()

bool GrayLib::cHashCode::isMatch ( const SUPER_t match) const
inline

◆ isMatchHexDigest()

bool GrayLib::cHashCode::isMatchHexDigest ( const char *  pszHexStr) const
inline

Check a hash code hex sequence against this.

◆ isValidHash()

bool GrayLib::cHashCode::isValidHash ( ) const
inlinenoexcept

Is hash valid or finalized? Not all zero?

◆ operator=()

THIS_t& GrayLib::cHashCode::operator= ( const THIS_t h1)
inline

◆ put_HexDigest()

HRESULT GrayLib::cHashCode::put_HexDigest ( const char *  pszInp)
inline

◆ put_RawDigest()

BYTE* GrayLib::cHashCode::put_RawDigest ( const SUPER_t m)
inline

◆ ref_RawDigest()

BYTE* GrayLib::cHashCode::ref_RawDigest ( )
inline

Allocate space if not already allocated.

◆ SetErase()

void GrayLib::cHashCode::SetErase ( )
inline

clean it out of memory for security reasons.

◆ SetRawDigest()

BYTE* GrayLib::cHashCode::SetRawDigest ( const BYTE *  pData,
size_t  nSize 
)
inline

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