QuickHash Library C++ Interface

CRIPEMD128::Final

void Final( unsigned char* pDest );
 

Parameters

 pDest

    [out] Pointer to the memory buffer that will receive the message digest.

Remarks

Call this member function to retrieve the message digest from the CRIPEMD128 object. The digest is retrieved in the memory buffer pointed by pDest. The size of the memory buffer pointed by pDest must be at least CRIPEMD128::DIGESTSIZE bytes.

After the Final method is performed, the CRIPEMD128 object is initialized for new calculations, as it would be constructed again.

Example

#include <fstream>
#include <QuickHash.h>

using namespace std;
using namespace QuickHash;

const unsigned int BUFF_SIZE = 1024;

int main()
{
    fstream file( "c:\\test.txt", ios::in | ios::binary );

    if( !file )
        return 1;

    unsigned char buff[ BUFF_SIZE ];
    unsigned char digest[ CRIPEMD128::DIGESTSIZE ];

    //Instantiate a CRIPEMD128 object

    CRIPEMD128 hash;

    //Calculate the digest by calling Update for each block of the file

    while( !file.eof() )
    { 
        file.read( ( char* )buff, BUFF_SIZE );
        hash.Update( buff, file.gcount() );
    }

    //Do final changes and get the digest

    hash.Final( digest );

    //Use the digest
    //...

    file.close();
    return 0;
}

 

 

CRIPEMD128 Overview   |   Class Members   |   Useful Links   |   HashCalc

 

See Also    CRIPEMD128::FinalHex, CRIPEMD128::Update


 

 

Send Feedback to SlavaSoft Inc. Tell a friend about QuickHash Library