Sample code for 30+ languages & platforms
C++

Workaround for the deprecated Crypt2.Decode method

Shows how to replace the deprecated Decode 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)
    {
    bool success = false;

    CkCrypt2 crypt;

    const char *encodedStr = "VGhpcyBpcyBhIHRlc3QgMTIz";
    const char *encoding = "base64";

    // ------------------------------------------------------------------------
    // The Decode method is deprecated:

    CkByteData outData;

    success = crypt.Decode(encodedStr,encoding,outData);

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

    CkBinData bd;
    bd.AppendEncoded(encodedStr,encoding);

    const unsigned char *pBytes = bd.GetData();
    }