Calculate crc32 with seed using Python

Question:

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

crc32(seed, data, length)

How can I calculate crc32 with seed using Python?

Asked By: Kokomelom

||

Answers:

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.

Answered By: Michael Ruth
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.