Node.js
Node.js
Workaround for the deprecated Crypt2.SetMacKeyBytes method
Shows how to replace the deprecated SetMacKeyBytes method. (Chilkat is moving away from the use of CkByteData.)Chilkat Node.js Downloads
NODEJS_PRELUDE
function chilkatExample() {
var success = false;
var crypt = new chilkat.Crypt2();
// ------------------------------------------------------------------------
// The SetMacKeyBytes method is deprecated:
var keyBytes = new chilkat.CkByteData();
// ...
// ...
success = crypt.SetMacKeyBytes(keyBytes);
// ------------------------------------------------------------------------
// Workaround.
// (Chilkat is moving away from using CkByteData)
var bdKey = new chilkat.BinData();
// ...
// ...
var encoding = "base64";
var base64_mackey = bdKey.GetEncoded(encoding);
success = crypt.SetMacKeyEncoded(base64_mackey,encoding);
}
chilkatExample();