python 2.x crc32计算不正确问题
python 2.x里面针对非ascii码计算出的结果为复数,跟其他语言计算出的结果不一样,上网查了下是python里面的按位取反的问题,下面给出一种正确的方法
def _crc32(v):
"""
Generates the crc32 hash of the v.
@return: str, the str value for the crc32 of the v
"""
return int('0x%x' % (binascii.crc32(v) & 0xffffffff),16)

















