.. function:: crc_hqx(data, value)
- Compute the binhex4 crc value of *data*, starting with *value* as the
- initial crc, and return the result.
+ Compute a 16-bit CRC value of *data*, starting with *value* as the
+ initial CRC, and return 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[, value])
crc: unsigned_int(bitwise=True)
/
-Compute hqx CRC incrementally.
+Compute CRC-CCITT incrementally.
[clinic start generated code]*/
static unsigned int
binascii_crc_hqx_impl(PyObject *module, Py_buffer *data, unsigned int crc)
-/*[clinic end generated code: output=8ec2a78590d19170 input=add8c53712ccceda]*/
+/*[clinic end generated code: output=8ec2a78590d19170 input=f18240ff8c705b79]*/
{
unsigned char *bin_data;
Py_ssize_t len;
"crc_hqx($module, data, crc, /)\n"
"--\n"
"\n"
-"Compute hqx CRC incrementally.");
+"Compute CRC-CCITT incrementally.");
#define BINASCII_CRC_HQX_METHODDEF \
{"crc_hqx", (PyCFunction)binascii_crc_hqx, METH_VARARGS, binascii_crc_hqx__doc__},
return return_value;
}
-/*[clinic end generated code: output=51173fc9718a5edc input=a9049054013a1b77]*/
+/*[clinic end generated code: output=6d70d5edd9373d92 input=a9049054013a1b77]*/