2 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
sub crc16
{
my($crc) = @_;
my $length = length($crc);
$crc = pack("H$length", $crc);
$ctx = Digest::CRC->new(type => "crc16");
$ctx->add($crc);
$ctx = Digest::CRC->new(width => 16, init => 0xFFFF,
xorout => 0x0000, poly => 0x8005, refin => 1, refout => 1);
$ctx->add($crc);
my @crc = split //,$ctx->hexdigest;
my $crc = join "",@crc[2,3,0,1];
return $crc;
}
2 Einträge, 1 Seite |