On this page
binascii.crc_hqx
Prev: binascii.crc32 | Up: binascii | Next: binascii.Error
Rel: binascii.a2b_base64, binascii.a2b_hex, binascii.a2b_qp, binascii.a2b_uu
Ref: docs.python.org — binascii.crc_hqx
Tags: #public #python3 #stdlib #binascii
Import
import binascii
from binascii import crc_hqx
Signature & Overview
binascii.crc_hqx(data, crc, /)
Compute CRC-CCITT incrementally.
Usage
import binascii
crc = binascii.crc_hqx(b"hello", 0)
assert isinstance(crc, int) and 0 <= crc < 65536
Gotchas
- Legacy 16-bit BinHex4 CRC: Pass
0as initial value; for modern checksums prefercrc32()orhashlib.sha256().
REPL Inspect
from binascii import crc_hqx
help(crc_hqx)
Linked from
Related notes
- tuts/python3/stdlib_module/binascii/crc32 Linked here; links to this page; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/Error Linked here; links to this page; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/binascii/a2b_base64 Linked here; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/a2b_hex Linked here; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/a2b_qp Linked here; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/a2b_uu Linked here; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/b2a_base64 shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/b2a_hex shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/b2a_qp shared tags: #binascii, #stdlib