dissect.util.hash.crc32

Module Contents

Functions

update

Update CRC32 checksum with data.

crc32

Calculate CRC32 checksum of some data, with an optional initial value and polynomial.

dissect.util.hash.crc32.update(crc: int, data: bytes, polynomial: int = 3988292384, table: tuple[int, Ellipsis] | None = None) int

Update CRC32 checksum with data.

Parameters:
  • crc – The initial value of the checksum.

  • data – The data to update the checksum with.

  • polynomial – The (reversed) polynomial to use for the CRC32 calculation. Default is 0xEDB88320 (crc32b).

  • table – Optional precomputed CRC32 table. If None, a table will be generated using the given polynomial.

dissect.util.hash.crc32.crc32(data: bytes, value: int = 0, polynomial: int = 3988292384, table: tuple[int, Ellipsis] | None = None) int

Calculate CRC32 checksum of some data, with an optional initial value and polynomial.

Parameters:
  • data – The data to calculate the checksum of.

  • value – The initial value of the checksum. Default is 0.

  • polynomial – The (reversed) polynomial to use for the CRC32 calculation. Default is 0xEDB88320 (crc32b).

  • table – Optional precomputed CRC32 table. If None, a table will be generated using the given polynomial.