[San-Diego-pm] CRC32, bitwise operators, and PHP (with solution)

Chris Radcliff chris_radcliff at mac.com
Tue Apr 17 10:41:16 PDT 2007


The prize goes to Bob (and his friend.)  Assigning the value to a  
variable and printing it shows that the two really are the same.  It  
was print() in PHP and Perl that were different.

Special thanks to C.W. Holeman II for the explanation, which seems to  
back this up.

Thanks!

~chris

On Apr 17, 2007, at 10:33 AM, Bob Kleemann wrote:

> A response from a friend of mine.  It looks like you fell for the  
> classic
> mistake in Perl using print, your statement looks to perl like:
>
> (print(crc32($key) >> 16)) & 0x7fff;
>
> Instead of:
>
> print((crc32($key) >> 16) & 0x7fff);
>



More information about the San-Diego-pm mailing list