From: Dan Scott Date: Wed, 15 Jun 2011 19:22:09 +0000 (-0400) Subject: Restore Unicode checksum algorithm X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b1fb8b50b50a6cc59455358ae06d06ec9c08ef5c;p=SIPServer.git Restore Unicode checksum algorithm 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 --- diff --git a/Sip/Checksum.pm b/Sip/Checksum.pm index 77b47a7..35abb3a 100644 --- a/Sip/Checksum.pm +++ b/Sip/Checksum.pm @@ -65,8 +65,7 @@ sub debug_split_print { 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); @@ -79,7 +78,6 @@ sub checksum { } return $check; - # return (-unpack('%16U*', $pkt) & 0xFFFF); } sub verify_cksum {