| 1 |
Digest::CRC version 0.24 |
| 2 |
======================== |
| 3 |
|
| 4 |
NAME |
| 5 |
Digest::CRC - Generic CRC functions |
| 6 |
|
| 7 |
DESCRIPTION |
| 8 |
The Digest::CRC module calculates CRC sums of all sorts. It contains |
| 9 |
wrapper functions with the correct parameters for CRC-SAE-J1850, CRC-CCITT, |
| 10 |
CRC-16 and CRC-32. |
| 11 |
|
| 12 |
SYNOPSIS |
| 13 |
# Functional style |
| 14 |
|
| 15 |
use Digest::CRC qw(crc32 crc16 crcccitt crc); |
| 16 |
$crc = crc32("123456789"); |
| 17 |
$crc = crc16("123456789"); |
| 18 |
$crc = crcccitt("123456789"); |
| 19 |
$crc = crcsaej1850("123456789"); |
| 20 |
|
| 21 |
$crc = crc($input,$width,$init,$xorout,$poly,$refin,$refout); |
| 22 |
|
| 23 |
# OO style |
| 24 |
use Digest::CRC; |
| 25 |
|
| 26 |
$ctx = Digest::CRC->new(type=>"crc16"); |
| 27 |
$ctx = Digest::CRC->new(width=>16, init=>0x0000, xorout=>0x0000, |
| 28 |
poly=>0x8005, refin=>1, refout=>1); |
| 29 |
$ctx->add($data); |
| 30 |
$ctx->addfile(*FILE); |
| 31 |
|
| 32 |
$digest = $ctx->digest; |
| 33 |
$digest = $ctx->hexdigest; |
| 34 |
$digest = $ctx->b64digest; |
| 35 |
|
| 36 |
INSTALLATION |
| 37 |
|
| 38 |
To install this module type the following: |
| 39 |
|
| 40 |
perl Makefile.PL |
| 41 |
make |
| 42 |
make test |
| 43 |
make install |
| 44 |
|
| 45 |
COPYRIGHT AND LICENCE |
| 46 |
CRC algorithm code taken from "A PAINLESS GUIDE TO CRC ERROR DETECTION |
| 47 |
ALGORITHMS". |
| 48 |
|
| 49 |
The author of this package disclaims all copyrights and releases it |
| 50 |
into the public domain. |