Sample code for 30+ languages & platforms
JavaScript

Example: Crypt2.CrcBd method

Demonstrates how to call the CrcBd method.
Note
This example is intended for running within a Chilkat.Js embedded JavaScript engine. All Chilkat JavaScript examples require Chilkat v11.4.0 or greater.
JavaScript
var crypt = new CkCrypt2();

var bd = new CkBinData();
bd.AppendString("123456789","us-ascii");

var crc32 = crypt.CrcBd("crc-32",bd);
// The decimal value is 3421780262 (converted to hex is 0xCBF43926)
console.log(crc32);

var crc8 = crypt.CrcBd("crc8",bd);
console.log(crc8);