Calculate BCC (Block Check Character) and LRC (Longitudinal Redundancy Check) values for data verification.
  • Character Set:
Result (HEX)
Result (Dec)
Result (Oct)
Result (Bin)

Description

BCC: Block Check Character, information group check code, since the check code is obtained by XORing all the data, it is commonly called XOR check. The specific algorithm is: the data of each byte (usually two hexadecimal characters) is XORed to obtain the check code.
For example, the hexadecimal data: 01 A0 9C FF 0D, Calculation: 01 xor A0 xor 7C xor FF xor 02 = 20, The check code is: 20

LRC:Longitudinal Redundancy Check.
LRC algorithm implementation:

lrc := 0

for each byte b in the buffer do

    lrc := (lrc + b) & 0xFF

lrc := (((lrc XOR 0xFF) + 1) & 0xFF)