6 #ifndef _INC_cHashCode_H
7 #define _INC_cHashCode_H
12 #include "../GrayLibBase.h"
82 return !this->IsZeros();
89 return get_DataSize();
93 size_t nSize1 = get_HashSize();
95 if (nSize1 != nSize2 || nSize2 == 0)
102 SUPER_t::Alloc(pData, nSize);
103 return SUPER_t::get_DataBytes();
112 return SUPER_t::get_DataBytes();
118 if (SUPER_t::isValidPtr())
165 template<
int TYPE_SIZE>
187 return cHashCode(this->get_DataBytes(), this->get_HashSize());
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
#define FAILED(x)
Definition: HResult.h:30
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
#define ASSERT(exp)
Definition: cDebugAssert.h:87
Definition: cHashCode.h:167
HRESULT put_HexDigest(const char *pszInp)
Definition: cHashCode.h:204
cHashCode get_HashCode() const
Definition: cHashCode.h:185
StrLen_t GetHexDigest(OUT char *pszHexString) const
Definition: cHashCode.h:190
bool isValidHash() const noexcept
Definition: cHashCode.h:174
size_t get_HashSize() const noexcept
Definition: cHashCode.h:179
cStringA get_HexDigest() const
Definition: cHashCode.h:195
Definition: cHashCode.h:43
void SetErase()
Definition: cHashCode.h:115
HRESULT put_HexDigest(const char *pszInp)
Definition: cHashCode.h:159
bool isValidHash() const noexcept
Definition: cHashCode.h:78
BYTE * SetRawDigest(const BYTE *pData, size_t nSize)
Definition: cHashCode.h:99
bool isMatch(const SUPER_t &match) const
Definition: cHashCode.h:91
~cHashCode()
Definition: cHashCode.h:72
cHashCode(const SUPER_t &h1)
Definition: cHashCode.h:68
cStringA get_HexDigest() const
Definition: cHashCode.h:140
BYTE * ref_RawDigest()
Definition: cHashCode.h:109
cHashCode() noexcept
Definition: cHashCode.h:56
cHashCode(size_t nSize)
Definition: cHashCode.h:59
StrLen_t get_HexSize() const
Definition: cHashCode.h:130
StrLen_t GetHexDigest(OUT char *pszHexString) const
Definition: cHashCode.h:135
BYTE * put_RawDigest(const SUPER_t &m)
Definition: cHashCode.h:105
bool isMatchHexDigest(const char *pszHexStr) const
Definition: cHashCode.h:149
size_t get_HashSize() const noexcept
Definition: cHashCode.h:84
cHashCode(const void *p, size_t nSize)
Definition: cHashCode.h:64
void ReleaseBuffer(StrLen_t nNewLength=k_StrLen_UNK)
Definition: cString.cpp:108
_TYPE_CH * GetBuffer(StrLen_t iMinLength)
Definition: cString.cpp:138
BYTE * get_DataBytes() const noexcept
Definition: cMem.h:354
bool IsZeros() const noexcept
Definition: cMem.h:400
size_t get_DataSize() const noexcept
Definition: cMem.h:344
@ Free
Definition: cLicense.h:22
SSL_Hash_TYPE
Definition: cHashCode.h:23
@ SSL_Hash_SHA512
Definition: cHashCode.h:36
@ SSL_Hash_NONE
Definition: cHashCode.h:30
@ SSL_Hash_SHA1
Definition: cHashCode.h:32
@ SSL_Hash_QTY
Definition: cHashCode.h:39
@ SSL_Hash_SHA384
Definition: cHashCode.h:35
@ SSL_Hash_SHA256
Definition: cHashCode.h:34
@ SSL_Hash_MD5
Definition: cHashCode.h:31
@ SSL_Hash_SHA224
Definition: cHashCode.h:33
int StrLen_t
the length of a string in chars (bytes for UTF8, wchar_t for UNICODE). or offset in characters....
Definition: StrConst.h:32
static bool IsZeros(const void *pData, size_t nSize) noexcept
Definition: cMem.h:65
static StrLen_t GetHexDigestSize(size_t nSize) noexcept
Definition: cMem.h:236
static StrLen_t __stdcall GetHexDigest(OUT char *pszHexString, const BYTE *pData, size_t nSizeData)
Definition: cMem.cpp:205
static HRESULT __stdcall SetHexDigest(const char *pszHexString, OUT BYTE *pData, size_t nSizeData)
Definition: cMem.cpp:221
static COMPARE_t Compare(const void *p1, const void *p2, size_t nSizeBlock) noexcept
Definition: cMem.h:78