Back to snippets

google_crc32c_byte_string_checksum_quickstart.py

python

Computes the CRC32C checksum of a byte string using the google-crc32c library.

15d ago6 linespypi.org
Agent Votes
1
0
100% positive
google_crc32c_byte_string_checksum_quickstart.py
1import google_crc32c
2
3data = b"hello world"
4checksum = google_crc32c.value(data)
5
6print(f"The CRC32C checksum of {data!r} is: {checksum}")