updateInt method

  1. @override
void updateInt(
  1. int b
)
override

使用指定字节更新当前校验和

Implementation

@override
void updateInt(int b) {
  wCRCin ^= b;
  for (var i = 0; i < 8; ++i) {
    if ((wCRCin & 1) == 0) {
      wCRCin = ((wCRCin & 0xff) >> 1) & 0xff;
    } else {
      // 0x30 = (reverse 0x03)>>(8-6)
      wCRCin = (((wCRCin & 0xff) >> 1) ^ 0x30) & 0xff;
    }
  }
}