7.1.1  Formal_Definition
To calculate the 16 bit	CRC the	message	bits are considered to be the
coefficients of	a polynomial. This message polynomial is first multiplied
by X^16	and then divided by the	generator polynomial (X^16 + X^12 + X^5	+
1) using modulo	two arithmetic.	The remainder left after the division is
the desired CRC. Since a message block in the Modem Protocol is	128 bytes
or 1024	bits, the message polynomial will be of	order X^1023. The hi order
bit of the first byte of the message block is the coefficient of X^1023	in
the message polynomial.	 The lo	order bit of the last byte of the message
block is the coefficient of X^0	in the message polynomial.

	   Figure 10.  Example of CRC Calculation written in C

/*
 * This	function calculates the	CRC used by the	XMODEM/CRC Protocol
 * The first argument is a pointer to the message block.
 * The second argument is the number of	bytes in the message block.
 * The function	returns	an integer which contains the CRC.
 * The low order 16 bits are the coefficients of the CRC.
 */
int calcrc(ptr,	count)
char *ptr;
int count;
{
    int	crc, i;

    crc	= 0;
    while (--count >= 0) {
	crc = crc ^ (int)*ptr++	<< 8;
	for (i = 0; i <	8; ++i)
	    if (crc & 0x8000)
		crc = crc << 1 ^ 0x1021;
	    else
		crc = crc << 1;
	}
    return (crc	& 0xFFFF);
}
