Z
`Zidane Tribal
it would appear that using the command 'crc("data")' from the String::CRC
returns incorrect results (although, they are at least consistently
incorrect).
for example, this script.....
#!/usr/bin/perl -w
use strict;
use String::CRC;
print "crc: " . crc($ARGV[0]) . " " . length($ARGV[0]) . "\n";
produces this output:
[email protected]:~/ps2/dev/crccheck$ ./crctest.pl 12345
crc: 3817467633 5
[email protected]:~/ps2/dev/crccheck$
whereas this command:
[email protected]:~/ps2/dev/crccheck$ echo -n "12345" | cksum
3288622155 5
[email protected]:~/ps2/dev/crccheck$
produces a different crc value.
this is also true using String::CRC32, DIGEST::CRC and DIGEST::CRC32 (using
the command line commands cksum and crc32 to create respective crc and
crc32 values to test against)
my query is simple.... why is this? although the values are different,
they are consistently different (i.e. the same result returned with each
call given the same data). can anyone explain what i am doing wrong?
`Zidane.
returns incorrect results (although, they are at least consistently
incorrect).
for example, this script.....
#!/usr/bin/perl -w
use strict;
use String::CRC;
print "crc: " . crc($ARGV[0]) . " " . length($ARGV[0]) . "\n";
produces this output:
[email protected]:~/ps2/dev/crccheck$ ./crctest.pl 12345
crc: 3817467633 5
[email protected]:~/ps2/dev/crccheck$
whereas this command:
[email protected]:~/ps2/dev/crccheck$ echo -n "12345" | cksum
3288622155 5
[email protected]:~/ps2/dev/crccheck$
produces a different crc value.
this is also true using String::CRC32, DIGEST::CRC and DIGEST::CRC32 (using
the command line commands cksum and crc32 to create respective crc and
crc32 values to test against)
my query is simple.... why is this? although the values are different,
they are consistently different (i.e. the same result returned with each
call given the same data). can anyone explain what i am doing wrong?
`Zidane.