Sample code for 30+ languages & platforms
C++

Workaround for the deprecated Crypt2.CrcBytes method

Shows how to replace the deprecated CrcBytes method. (Chilkat is moving away from the use of CkByteData.)

Chilkat C++ Downloads

C++
#include <CkCrypt2.h>
#include <CkByteData.h>
#include <CkBinData.h>

void ChilkatSample(void)
    {
    CkCrypt2 crypt;

    const char *path = "c:/someDir/example.dat";
    const char *algorithm = "crc-32";

    //  ------------------------------------------------------------------------
    //  The CrcBytes method is deprecated:

    CkByteData inData;
    inData.loadFile(path);

    unsigned long crc = crypt.CrcBytes(algorithm,inData);

    //  ------------------------------------------------------------------------
    //  Workaround.
    //  (Chilkat is moving away from using CkByteData)

    CkBinData bdIn;
    bdIn.LoadFile(path);

    crc = crypt.CrcBd(algorithm,bdIn);
    }