resultType
crc_reflected_poly(const readType * data, unsigned n, resultType remainder) {
    unsigned byte;
    unsigned char bitp; 
    resultType rpoly;

    rpoly = reflect(POLYNOMIAL, WIDTH);
    for (byte = 0; byte != n; byte++) {
        remainder ^= data[byte];

        for (bitp = 8; bitp > 0; bitp--) {
            if (remainder & LSb) {
                remainder = (remainder >> 1) ^ rpoly;
            } else {
                remainder >>= 1;
            }
        }
    }

    return remainder;
}