summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-12-24 07:53:57 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-12-24 07:53:57 (GMT)
commit3698bd262fb1a7289d6e6266914b19e51a4ee37c (patch)
treed00a0b7366a70fc7383ba4d5bf322b7ee514c742
parentc04957531eac2916a0d7eb534e4d4c314c405360 (diff)
downloadcpython-3698bd262fb1a7289d6e6266914b19e51a4ee37c.zip
cpython-3698bd262fb1a7289d6e6266914b19e51a4ee37c.tar.gz
cpython-3698bd262fb1a7289d6e6266914b19e51a4ee37c.tar.bz2
Issue #29004: Document binascii.crc_hqx() implements CRC-CCITT
-rw-r--r--Doc/library/binascii.rst6
-rw-r--r--Modules/binascii.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/Doc/library/binascii.rst b/Doc/library/binascii.rst
index 5eb7c4b..38f616a 100644
--- a/Doc/library/binascii.rst
+++ b/Doc/library/binascii.rst
@@ -101,8 +101,10 @@ The :mod:`binascii` module defines the following functions:
.. function:: crc_hqx(data, crc)
- Compute the binhex4 crc value of *data*, starting with an initial *crc* and
- returning the result.
+ Compute a 16-bit CRC value of *data*, starting with an initial *crc* and
+ returning the result. This uses the CRC-CCITT polynomial
+ *x*:sup:`16` + *x*:sup:`12` + *x*:sup:`5` + 1, often represented as
+ 0x1021. This CRC is used in the binhex4 format.
.. function:: crc32(data[, crc])
diff --git a/Modules/binascii.c b/Modules/binascii.c
index 06af60f..1e785fa 100644
--- a/Modules/binascii.c
+++ b/Modules/binascii.c
@@ -842,7 +842,7 @@ binascii_rledecode_hqx(PyObject *self, PyObject *args)
}
PyDoc_STRVAR(doc_crc_hqx,
-"(data, oldcrc) -> newcrc. Compute hqx CRC incrementally");
+"(data, oldcrc) -> newcrc. Compute CRC-CCITT incrementally");
static PyObject *
binascii_crc_hqx(PyObject *self, PyObject *args)