Node.js
Node.js
Workaround for the deprecated Crypt2.HashFile method
Shows how to replace the deprecated HashFile method. (Chilkat is moving away from the use of CkByteData.)Chilkat Node.js Downloads
NODEJS_PRELUDE
function chilkatExample() {
var crypt = new chilkat.Crypt2();
crypt.HashAlgorithm = "sha256";
var path = "c:/someDir/example.dat";
// ------------------------------------------------------------------------
// The HashFile method is deprecated:
outData = crypt.HashFile(path);
// ------------------------------------------------------------------------
// Workaround.
// (Chilkat is moving away from using CkByteData)
crypt.EncodingMode = "hex_lower";
var hex_hash = crypt.HashFileENC(path);
}
chilkatExample();