checksum

Seogyu Gim·2021년 8월 2일
0

What is checksum ?

A checksum is small-sized block of data derived from block of digital data for the purpose of deecting errors tah may have been introduced during its transmission or storage. By themselves, checksums are often used to verify data integrity but are not relied upon to verify data authenticity.
The procedure which generates this checksum is called a checksum function or checksum algorithm. - Wikipedia

Example

0x25 = 37
0x62 = 98
0x3F = 63
0x52 = 82

1) 0x25 + 0x62 + 0x3F + 0x52 = 0x118(280)
-> 0001 0001 1000
2) drop carry nibble
-> 0001 1000
3) 2's complements
-> 1110 0111(1's complements) + 1
-> 1110 1000
4) to Hex
-> 0xE8 (=Checksum byte)

Test

1) 0x118(origin) + 0xE8(checksum) = 0x200(512
2) to binary
-> 0010 0000 0000
3) drop carry nibble
-> 0000 0000

profile
의미 있는 일을 하고싶은 개발자

0개의 댓글