Crypt::Checksum::CRC32 - Compute CRC32 checksum
use Crypt::Checksum::CRC32; $d = Crypt::Checksum::CRC32->new; $d->add('any data'); $d->addfile('filename.dat'); $d->addfile(*FILEHANDLE); $checksum_raw = $d->digest; # raw bytes $checksum_hex = $d->hexdigest; # hexadecimal form
Calculating CRC32 checksums (OO interface);
Since: CryptX-0.032
Constructor, returns a reference to the checksum object.
$d = Crypt::Checksum::CRC32->new;
Creates a copy of the checksum object state and returns a reference to the copy.
$d->clone();
Reinitialize the checksum object state and returns a reference to the checksum object.
$d->reset();
All arguments are appended to the message we calculate checksum for. The return value is the checksum object itself.
$d->add('any data'); #or $d->add('any data', 'more data', 'even more data');
The content of the file (or filehandle) is appended to the message we calculate checksum for. The return value is the checksum object itself.
$d->addfile('filename.dat'); #or $d->addfile(*FILEHANDLE);
BEWARE: You have to make sure that the filehandle is in binary mode before you pass it as argument to the addfile() method.
Returns the binary checksum (raw bytes).
$result_raw = $d->digest();
Returns the checksum encoded as a hexadecimal string.
$result_hex = $d->hexdigest();
CryptX, Crypt::Checksum
https://en.wikipedia.org/wiki/Cyclic_redundancy_check
To install CryptX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CryptX
CPAN shell
perl -MCPAN -e shell install CryptX
For more information on module installation, please visit the detailed CPAN module installation guide.