(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.) Note: This example requires Chilkat v11.0.0 or greater.
#include <CkCrypt2.h>
#include <CkByteData.h>
#include <CkBinData.h>
void ChilkatSample(void)
{
CkCrypt2 crypt;
const char *encodedStr = "VGhpcyBpcyBhIHRlc3QgMTIz";
const char *encoding = "base64";
bool success;
// ------------------------------------------------------------------------
// 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();
}
|