I have a hexadecimal code as below.
025001ef5401582102049123a715060e04311c032d0100000100da646405ffaab90000000e0c002a054b006e0000f10170000100050701f83fe40002000500009219120003000400014cc80004000400a1d0330005000400252e280010000201170012000e484c543530305f56333034373042001300143839363630333230323030303237383737363446001400011f0015000e01030200030004000501060007000016000202cb300900249906000232339907000131990800073030303839363399090005323033303090110001013010000601000201060130120004000000003013000900016200ec0040010030140005fdffff5f0b30150002000d3016000200213017000104301800020004301900020061301a0008017d0196012801d4901000010160c00002038860d000012862f000020000605000017f64900001006010000100500100010050020001015003000100500400010050050002000050060002155450070002155450080001005009000100500a000100500b000100500c000100500d000146500e000400000000500f00010050100004000000005011000400000000501200040000000050130004000000005014000400000000501500040000000050160004000007d45017000200295019000400000000501a0006020000000000501b000100501c0002003c501d0006000000000000
Then, I go to https://www.scadacore.com/tools/programming-calculators/online-checksum-calculator/ to calculate the CheckSum8 Xor. The result returns "a0". I want to know how this calculator works. Can anyone explain to me with Python function? Thank you.
CheckSum8 Xor
I have played with tool you linked and it seems to be using Parity word algorithm in this case you might compute it as follows:
0
s and 1
s)Note that as we need 4-bits to write one hex digit, we might just replace 1. and 2. using split into chunks, each holding 2 base-16 digits.
Example: input is ABCDEF
then chunks are AB
, CD
, EF
checksum is AB
xor CD
xor EF
which gives 89
. In python
this might be expressed as
print(hex(0xAB ^ 0xCD ^ 0xEF))
output
0x89