String::CRC323pm
Perl interface for cyclic redundancy check generation
Usage
use String::CRC32;$crc = crc32("some string");$crc = crc32("some string", initvalue);$somestring = "some string";$crc = crc32($somestring);printf "%08x\n", $crc;open my $fh, '<', 'location/of/some.file' or die $!;binmode $fh;$crc = crc32($fh);close $fh;
Overview
The CRC32 module calculates CRC sums of 32 bit lengths as integers. It generates the same CRC values as ZMODEM, PKZIP, PICCHECK and many others.
Despite its name, this module is able to compute the checksum of files as well as strings.
Examples
$crc = crc32("some string");
results in the same as
$crc = crc32(" string", crc32("some"));
This is useful for subsequent CRC checking of substrings.
You may even check files:
open my $fh, '<', 'location/of/some.file' or die $!;binmode $fh;$crc = crc32($fh);close $fh;
A init value may also have been supplied in the above example.
Releases
12 releases since Debian 3.1 (Sarge); the text changed 10 times.