C
Cab Colino
hi,
i try to implement a calculation that i got in c++
in my perl project.
example:
c++:
unsigned char byte[] = "a";
int crc32 = 0xFFFFFFFF;
crc32 = ((crc32) >> 8) ^ array[(chr[0]) ^ ((crc32) & 0x000000FF)];
crc32 = -397917764
perl:
$crc32 = 0xFFFFFFFF;
$byte = "a";
$byte = unpack("C",$byte);
$crc32 = (($crc32) >> 8) ^ $array[($byte) ^ (($crc32) & 0x000000FF)];
$crc32 = 390611388
if you can see, the problem is that i get different results in the two
callclations. any suggestions why?
i would be graceful for any suggest.
cya
cab
i try to implement a calculation that i got in c++
in my perl project.
example:
c++:
unsigned char byte[] = "a";
int crc32 = 0xFFFFFFFF;
crc32 = ((crc32) >> 8) ^ array[(chr[0]) ^ ((crc32) & 0x000000FF)];
crc32 = -397917764
perl:
$crc32 = 0xFFFFFFFF;
$byte = "a";
$byte = unpack("C",$byte);
$crc32 = (($crc32) >> 8) ^ $array[($byte) ^ (($crc32) & 0x000000FF)];
$crc32 = 390611388
if you can see, the problem is that i get different results in the two
callclations. any suggestions why?
i would be graceful for any suggest.
cya
cab