CRC8 library is not counting 0x00 bytes when calc

Hi, I want to calculate polynomial 0xEA crc8 checksum with 0x00 initial and final XOR . My char str = { 0x01 , 0x01, 0x00, 0x01} the crc8 should be 1A but is giving me A0 because is not calculating the 0x00 , if I will do calculation just for {0x01 , 0x01,0x01} then will be correct. Can anyone helps me please ?

#include "CRC.h"


char str[8] =  {0x01, 0x01, 0x00, 0x01};
CRC8 crc;


void setup()
{
  Serial.begin(115200);
  Serial.println(__FILE__);


  test();
}


void loop()
{
}


void test()
{
  Serial.println(crc8((uint8_t *)str, 4, 0xEA), HEX);
}```

For help, please post the code, using code tags.

your sketch works here unchanged on an UNO with - GitHub - RobTillaart/CRC: CRC library for Arduino

Output:

...\Arduino\sketch_feb29c\sketch_feb29c.ino
1A

Which board do you use?
Which library did you use?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.