1Digest::CRC(3) User Contributed Perl Documentation Digest::CRC(3)
2
3
4
6 Digest::CRC - Generic CRC functions
7
9 # Functional style
10
11 use Digest::CRC qw(crc32 crc16 crcccitt crc crc8);
12 $crc = crc32("123456789");
13 $crc = crc16("123456789");
14 $crc = crcccitt("123456789");
15 $crc = crc8("123456789");
16
17 $crc = crc($input,$width,$init,$xorout,$refout,$poly,$refin);
18
19 # OO style
20 use Digest::CRC;
21
22 $ctx = Digest::CRC->new(type=>"crc16");
23 $ctx = Digest::CRC->new(width=>16, init=>0x2345, xorout=>0x0000,
24 poly=>0x8005, refin=>1, refout=>1, cont=>1);
25
26 $ctx->add($data);
27 $ctx->addfile(*FILE);
28
29 $digest = $ctx->digest;
30 $digest = $ctx->hexdigest;
31 $digest = $ctx->b64digest;
32
34 The Digest::CRC module calculates CRC sums of all sorts. It contains
35 wrapper functions with the correct parameters for CRC-CCITT, CRC-16 and
36 CRC-32.
37
39 Oliver Maul, oli@42.nu
40
42 CRC algorithm code taken from "A PAINLESS GUIDE TO CRC ERROR DETECTION
43 ALGORITHMS".
44
45 The author of this package disclaims all copyrights and releases it
46 into the public domain.
47
48
49
50perl v5.8.8 2007-11-05 Digest::CRC(3)