Home > Blockchain >  Calculate crc32 with seed using Python
Calculate crc32 with seed using Python

Time:11-22

In linux/crc32.h there is crc32 that define :

crc32(seed, data, length)

Hiw can I calculate crc32 with seed using Python?

CodePudding user response:

Go to the docs:

import zlib
help(zlib.crc32)
Help on built-in function crc32 in module zlib:

crc32(data, value=0, /)
    Compute a CRC-32 checksum of data.

      value
        Starting value of the checksum.

    The returned checksum is an integer.

Data are the same between the two implementations. Seed in the C implementation is value in the Python implementation. Note that it defaults to 0 in zlib.crc32.

  • Related