This checksum algorithm was verified to work with
3M V-series self-check machines running with encoding
Unicode, which is important to sites with large
collections of non-English materials.
Signed-off-by: Dan Scott <dscott@laurentian.ca>
sub checksum {
my $pkt = shift;
- # my $u = unpack('%16U*', $pkt);
- my $u = unpack('%U*', $pkt);
+ my $u = unpack('%16C*', $pkt);
my $check = ($u * -1) & 0xFFFF;
if ($debug) {
my $total = debug_split_print($pkt);
}
return $check;
- # return (-unpack('%16U*', $pkt) & 0xFFFF);
}
sub verify_cksum {