calculateCrc function

int calculateCrc(
  1. List<int> data
)

Implementation

int calculateCrc(List<int> data) {
  int fcs = 0xffff;
  for (int b in data) {
    int index = (fcs ^ b) & 0xff;
    fcs = (fcs >> 8) ^ crcTab[index];
  }
  return fcs ^ 0xffff;
}