why
from zlib import crc32
import numpy as np
x = crc32(np.int64(0))
print(x)
the output is 1696784233, how is this possible since I thought CRC gives the reminder of some generative polynomial with the parameter but since the parameter is 0 how is the output not 0?
This is because the zlib version of CRC-32 is specifically designed to handle leading zeroes (as well as any trailing zeroes inserted after the checksum). According to Wikipedia:
You can manually undo that to see that
zlib.crc32(numpy.int64(0), 0xFF_FF_FF_FF) == 0xFF_FF_FF_FF, and in factzlib.crc32(bytes(i), 0xFF_FF_FF_FF) == 0xFF_FF_FF_FFfor any natural numberi.