Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 520569e

Browse files
committed
Issue #29004: Merge crc_hqx() doc from 3.5
2 parents 3a72ee5 + 3310e14 commit 520569e

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

Doc/library/binascii.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,10 @@ The :mod:`binascii` module defines the following functions:
116116

117117
.. function:: crc_hqx(data, value)
118118

119-
Compute the binhex4 crc value of *data*, starting with *value* as the
120-
initial crc, and return the result.
119+
Compute a 16-bit CRC value of *data*, starting with *value* as the
120+
initial CRC, and return the result. This uses the CRC-CCITT polynomial
121+
*x*:sup:`16` + *x*:sup:`12` + *x*:sup:`5` + 1, often represented as
122+
0x1021. This CRC is used in the binhex4 format.
121123

122124

123125
.. function:: crc32(data[, value])

Modules/binascii.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,12 +900,12 @@ binascii.crc_hqx -> unsigned_int
900900
crc: unsigned_int(bitwise=True)
901901
/
902902
903-
Compute hqx CRC incrementally.
903+
Compute CRC-CCITT incrementally.
904904
[clinic start generated code]*/
905905

906906
static unsigned int
907907
binascii_crc_hqx_impl(PyObject *module, Py_buffer *data, unsigned int crc)
908-
/*[clinic end generated code: output=8ec2a78590d19170 input=add8c53712ccceda]*/
908+
/*[clinic end generated code: output=8ec2a78590d19170 input=f18240ff8c705b79]*/
909909
{
910910
const unsigned char *bin_data;
911911
Py_ssize_t len;

Modules/clinic/binascii.c.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ PyDoc_STRVAR(binascii_crc_hqx__doc__,
263263
"crc_hqx($module, data, crc, /)\n"
264264
"--\n"
265265
"\n"
266-
"Compute hqx CRC incrementally.");
266+
"Compute CRC-CCITT incrementally.");
267267

268268
#define BINASCII_CRC_HQX_METHODDEF \
269269
{"crc_hqx", (PyCFunction)binascii_crc_hqx, METH_VARARGS, binascii_crc_hqx__doc__},
@@ -550,4 +550,4 @@ binascii_b2a_qp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *k
550550

551551
return return_value;
552552
}
553-
/*[clinic end generated code: output=1f8d6e48f75f6d1e input=a9049054013a1b77]*/
553+
/*[clinic end generated code: output=458eb09731cb7877 input=a9049054013a1b77]*/

0 commit comments

Comments
 (0)