Sample code for 30+ languages & platforms
Perl

Workaround for the deprecated Crypt2.CrcBytes method

Shows how to replace the deprecated CrcBytes method. (Chilkat is moving away from the use of CkByteData.)

Chilkat Perl Downloads

Perl
use chilkat();

$crypt = chilkat::CkCrypt2->new();

$path = "c:/someDir/example.dat";
$algorithm = "crc-32";

# ------------------------------------------------------------------------
# The CrcBytes method is deprecated:

$inData = chilkat::CkByteData->new();
$inData->loadFile($path);

$crc = $crypt->CrcBytes($algorithm,$inData);

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

$bdIn = chilkat::CkBinData->new();
$bdIn->LoadFile($path);

$crc = $crypt->CrcBd($algorithm,$bdIn);