The (canonical) way to perform sign extension is via xor and subtract: sub sxtb { (shift ^ 0x80) - 0x80 }
For CRC digest, I'd consider using a specific module, but in a pinch, the following should work:
sub sxt { ((0xffffffff & shift) ^ 0x80000000) - 0x80000000 } ... $crc = ($crc >> 8) ^ ... $crc = sxt $crc; ...
In reply to Re: reproducing javascripts >> operator
by oiskuu
in thread reproducing javascripts >> operator
by mje
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |