|
QuickHash Library |
C++ Interface |
|
CRIPEMD128::CalculateHex
static void CalculateHex( char* pDest,
const unsigned char* pSrc, unsigned int nSrcLength,
bool bUpper = false );
static void CalculateHex( char* pDest,
const char* pSrc, bool bUpper = false );
Parameters
pDest
[out] Pointer to the text
buffer that will receive the message digest.
pSrc
[in]
In the first case - pointer to the
continuous memory block for which to calculate the message digest.
In the second case - pointer to the
null-terminated string for which to calculate the message digest.
nSrcLength
[in] Length in bytes
of the memory block.
bUpper
[in] Uppercase flag.
If
bUpper is false, the received message digest represents a lowercase string,
otherwise it represents an uppercase string.
Remarks
-
static void CalculateHex( char* pDest,
const unsigned char* pSrc, unsigned int nSrcLength,
bool bUpper = false );
Calculates the message digest for the memory block
pointed by pSrc.
Calculates the message digest for the
null-terminated string pointed by pSrc.
The digest is retrieved as a null-terminated hexadecimal
string in the text buffer
pointed by pDest. The size of the text buffer pointed by pDest
must be at least CRIPEMD128::HEXDIGESTSIZE characters.
Example
#include <string.h>
#include <QuickHash.h>
using namespace QuickHash;
int main()
{
char mydata[] = "Test String";
char digesthex[ CRIPEMD128::HEXDIGESTSIZE ]; //0 terminated
//Calculate and retrieve the digest in hex format
CRIPEMD128::CalculateHex( digesthex, (const unsigned char*)mydata, strlen( mydata ) );
//Use the digest
//...
return 0;
}
|
|
Note.
In the above example mydata is
a null-terminated string. Therefore, the call
CRIPEMD128::CalculateHex( digesthex, (const unsigned char*)mydata, strlen(
mydata ) );
can be replaced by
CRIPEMD128::CalculateHex( digesthex,
mydata );
CRIPEMD128 Overview
| Class Members
|
Useful Links | HashCalc
See Also CRIPEMD128::Calculate
|