Archive::Lha::CRC - Archive::Lha::CRC documentation


Archive-Lha documentation Contained in the Archive-Lha distribution.

Index


Code Index:

NAME

Top

Archive::Lha::CRC

SYNOPSIS

Top

  use bytes;
  $crc = Archive::Lha::CRC::update( $crc, $str, length($str) );

DESCRIPTION

Top

This provides one utility function to calculate CRC-16, well, reversed CRC-16-IBM (X^16 + X^15 + X^2 + 1, not 0x8005 but 0xA001 one).

METHODS

Top

update

takes a previous value, a string, the length of the string in bytes, and returns the updated CRC-16 value. Note that this is a thin wrapper of a C function and you actually need to pass the length in bytes, in other words, sizeof(unsigned char). If you get a wrong value, check your input callback you pass to the Archive::Lha::Decode object. Your archive may be broken, but most probably you've converted something (say, the ends of line) to your (or your system's) taste implicitly.

AUTHOR

Top

Kenichi Ishigaki, <ishigaki@cpan.org>

COPYRIGHT AND LICENSE

Top


Archive-Lha documentation Contained in the Archive-Lha distribution.

package Archive::Lha::CRC;

use strict;
use warnings;
use Archive::Lha;  # to load XS

1;

__END__