]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #29004: Document binascii.crc_hqx() implements CRC-CCITT
authorMartin Panter <vadmium+py@gmail.com>
Sat, 24 Dec 2016 07:53:57 +0000 (07:53 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Sat, 24 Dec 2016 07:53:57 +0000 (07:53 +0000)
Doc/library/binascii.rst
Modules/binascii.c

index 5eb7c4b8def63c7c08a2f042d3db5abc1cd47005..38f616a9348d681e715c2125d7756f01dbaf701b 100644 (file)
@@ -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])
index 06af60f587e980c6d4ffe309879a57708de2e435..1e785fa8faaa5fd43a36f722f0f8791b5b7454c9 100644 (file)
@@ -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)