04 Feb 2021 07:03:27 UTC
- Distribution: String-CRC32
- Module version: 2.100
- Source (raw)
- Pod Source (raw)
- Browse (raw)
- How to Contribute
- Issues (0)
- Testers (2382 / 0 / 0)
- KwaliteeBus factor: 1
- 88.57% Coverage
- License: unrestricted
- Activity24 month
- Download (7.81KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:2 non-PAUSE usersLEEJO Lee Johnson
String::CRC32 - Perl interface for cyclic redundancy check generation
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;
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.
$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.
Soenke J. Peters <firstname.lastname@example.org>
Current maintainer: LEEJO
Address bug reports and comments to: https://github.com/leejo/string-crc32/issues
CRC algorithm code taken from CRC-32 by Craig Bruce. The module stuff is inspired by a similar perl module called String::CRC by David Sharnoff & Matthew Dillon. Horst Fickenscher told me that it could be useful to supply an init value to the crc checking function and so I included this possibility.
The author of this package disclaims all copyrights and releases it into the public domain.
Module Install Instructions
To install String::CRC32, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install String::CRC32
For more information on module installation, please visit the detailed CPAN module installation guide.