Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products. If you have feedback or questions as you navigate the site, click Send Feedback.

Python 2 is no longer supported by the community. We recommend that you migrate Python 2 apps to Python 3.

google.appengine.api.files.crc32c module

Summary

Implementation of CRC-32C checksumming as in rfc3720 section B.4.

See http://en.wikipedia.org/wiki/Cyclic_redundancy_check for details on CRC-32C.

This code is a manual python translation of c code generated by pycrc 0.7.1 (http://www.tty1.net/pycrc/). Command line used: ‘./pycrc.py –model=crc-32c –generate c –algorithm=table-driven’

Contents

google.appengine.api.files.crc32c.crc(data)source

Compute CRC-32C checksum of the data.

Parameters

data – byte array, string or iterable over bytes.

Returns

32-bit CRC-32C checksum of data as long.

google.appengine.api.files.crc32c.crc_finalize(crc)source

Finalize CRC-32C checksum.

This function should be called as last step of crc calculation.

Parameters

crc – 32-bit checksum as long.

Returns

finalized 32-bit checksum as long

google.appengine.api.files.crc32c.crc_update(crc, data)source

Update CRC-32C checksum with data.

Parameters
  • crc – 32-bit checksum to update as long.

  • data – byte array, string or iterable over bytes.

Returns

32-bit updated CRC-32C as long.