unsigned onecrc(crc, cp)
register unsigned int crc;
char cp;

{
register int count;
unsigned c;

    c = cp & 255;

    for (count = 8; --count >= 0; ) {
        if (crc & 0x8000) {
            crc <<= 1;
            crc += (((c <<= 1) & 0400) != 0);
            crc ^= 0x1021;
        }

        else {
            crc <<= 1;
            crc += (((c <<= 1) & 0400) != 0);
        }
    }

    return(crc);
}


/* Figure 16.12: CRC-CCITT calculation for one character */
