|
QuickHash Library |
C++ Interface |
|
CTiger::Calculate
static void Calculate( unsigned char*
pDest, const unsigned char* pSrc, unsigned int
nSrcLength );
static void Calculate( unsigned char*
pDest, const char* pSrc );
Parameters
pDest
[out] Pointer to the memory
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.
Remarks
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 in the memory buffer pointed by
pDest. The size of the memory buffer pointed by pDest must be at
least CTiger::DIGESTSIZE bytes.
Example
#include <string.h>
#include <QuickHash.h>
using namespace QuickHash;
int main()
{
char mydata[] = "Test String";
unsigned char digest[ CTiger::DIGESTSIZE ];
//Calculate and retrieve the digest
CTiger::Calculate( digest, (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
CTiger::Calculate( digest, (const unsigned char*)mydata, strlen(
mydata ) );
can be replaced by
CTiger::Calculate( digest,
mydata );
CTiger Overview
| Class Members
|
Useful Links | HashCalc
See Also CTiger::CalculateHex
|