(original) (raw)
changeset: 105805:5ae6102270df branch: 2.7 parent: 105792:d1c16588644f user: Martin Panter vadmium+py@gmail.com date: Sat Dec 24 07:53:57 2016 +0000 files: Doc/library/binascii.rst Modules/binascii.c description: Issue #29004: Document binascii.crc_hqx() implements CRC-CCITT diff -r d1c16588644f -r 5ae6102270df Doc/library/binascii.rst --- a/Doc/library/binascii.rst Fri Dec 23 04:12:46 2016 -0500 +++ b/Doc/library/binascii.rst Sat Dec 24 07:53:57 2016 +0000 @@ -101,8 +101,10 @@ .. 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 -r d1c16588644f -r 5ae6102270df Modules/binascii.c --- a/Modules/binascii.c Fri Dec 23 04:12:46 2016 -0500 +++ b/Modules/binascii.c Sat Dec 24 07:53:57 2016 +0000 @@ -842,7 +842,7 @@ } 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) /vadmium+py@gmail.com