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;
Despite its name, this module is able to compute the checksum of files as well as strings.
$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.
Current maintainer: LEEJO
Address bug reports and comments to: <https://github.com/leejo/string-crc32/issues>
The author of this package disclaims all copyrights and releases it into the public domain.