issues with implementing CRC8 on arduino serial

im trying implementing crc8 on serial communication arduino,but i having trouble on receiver side, it doesnt giving a zero remainder, is anything wrong with my code or i didnt get how the crc works, but i am already searching and this is what i got pls help .

Transmitter side:

void loop() {
value=220;
LFSRBuffer=crcNaive(value);
result = (value<<5)|LFSRBuffer;
mySerial.write(highByte(result));
mySerial.write(lowByte(result));
delay(3000);
}


uint16_t crcNaive(byte const message)
{
    uint8_t  remainder = message;  
    for (int bit = 0; bit < 8; bit++)
    {
        if ((remainder & 0x80) != 0)
        {
            remainder = (byte)((remainder<<1) ^ POLYNOMIAL);
        }
    else{
        remainder <<=1;
        }
    }
    return remainder;
}

Receiver side:

void loop()
{ 
  if (mySerial.available() > 0) {
    hi = mySerial.read();
    lo = mySerial.read();
    result = word(hi,lo);
  }
uint16_t resultx = crcNaive(result);
Serial.println(resultx,BIN);
delay(3000);
}

uint16_t crcNaive(uint16_t const message)
{
    uint16_t  remainder = message;  
    for (int bit = 0; bit < 8; bit++)
    {
        if ((remainder & 0x80) != 0)
        {
            remainder = (byte)((remainder<<1) ^ POLYNOMIAL);
        }
    else{
        remainder <<=1;
        }
    }
    return remainder;
}

Transmitter:

result = (value<<5)|LFSRBuffer;

5? How many bits in a byte?

Receiver:

 if (mySerial.available() > 0) {

This will only guarantee you that the Arduino has read at least one byte. Your code assumes that it can read two bytes.

Change it to > 1

Next time, post all of the code in each sketch - but thanks for the code tags.

Pete

And the CRC check in the receiver only uses the low order 8 bits of the uint16_t. It should be checking all 16 bits. Then it should give you zero for the remainder.

Pete