- Timestamp:
- 12/21/07 18:32:34 (13 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Archive-Lha/trunk/lib/Archive/Lha/Decode/LH0.pm
r3270 r3413 4 4 use warnings; 5 5 use Carp; 6 use bytes; 6 7 use Archive::Lha::Constants; 7 use Archive::Lha ::CRC;8 use Archive::Lha; 8 9 9 10 sub new { … … 26 27 my $self = shift; 27 28 29 my $crc = 0; 28 30 my $total = 0; 29 31 my $size = $self->{size}; 30 my $crc = Archive::Lha::CRC->new;31 32 32 while ( $total < $size ) { 33 33 my $left = $size - $total; … … 35 35 my $str = $self->{read}->( $length ); 36 36 $self->{write}->( $str ); 37 $crc ->add( $str);37 $crc = Archive::Lha::crc16( $crc, $str, length($str) ); 38 38 $total += $length; 39 39 } 40 croak "CRC mismatch" if $crc->value != $self->{crc16}; 40 croak "CRC mismatch" if $crc != $self->{crc16}; 41 return $crc; 41 42 } 42 43
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)