Goede dag,
Voor de onderstaande hexadecimaal moet ik een "8-bit additive checksum" berekenen:
04D204000000000000000006000000000A45F422810000
De checksum van de hexadecimaal zal C6 moeten zijn.
Dit vond ik op internet:
8-bit additive checksum is straight forward. You add the ASCII value of all bytes. To get the checksum from the sum of the ASCII values you do modulo 256.
If the messages is an array from 1:70 the the checksum is calculated as follows: cs=SUM(1:70) mod 256
Ik heb verschillende berekeningen geprobeerd te maken, maar helaas kreeg ik niet het juiste resultaat.
Heeft iemand een idee hoe ik dit kan berekenen in PHP?
Alvast bedankt
Voor de onderstaande hexadecimaal moet ik een "8-bit additive checksum" berekenen:
04D204000000000000000006000000000A45F422810000
De checksum van de hexadecimaal zal C6 moeten zijn.
Dit vond ik op internet:
8-bit additive checksum is straight forward. You add the ASCII value of all bytes. To get the checksum from the sum of the ASCII values you do modulo 256.
If the messages is an array from 1:70 the the checksum is calculated as follows: cs=SUM(1:70) mod 256
Ik heb verschillende berekeningen geprobeerd te maken, maar helaas kreeg ik niet het juiste resultaat.
Heeft iemand een idee hoe ik dit kan berekenen in PHP?
Alvast bedankt