[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: strange behaviour with luaL_checkinteger()
- From: David Manura <dm.lua@...>
- Date: Sat, 4 Jul 2009 14:37:35 -0400
On Sat, Jul 4, 2009 at 10:36 AM, KHMan wrote:
> There is no such thing as a negative number in a CRC calculation. If you got
> a negative number displayed, it's in the wrong representation.
For example, be careful if casting an unsigned 32-bit integer as
signed, as in Python 2.6:
$ python
>>> import binascii
>>> binascii.crc32("test") # might not be what you expected
-662733300
>>> binascii.crc32("test") & 0xffffffff # workaround
3632233996L