<iakovos (AT) gmail (DOT) com> wrote
Quote:
Would anyone care to tell me the formula on how to calculate a BCC
(Block-check) on a string? In mve Pick there's a user-exit that does it
but I don't know the formula. Searching on google I found that I need
to do an XOR on each character of the string, but the bit XOR I know
requires two chars (one a constant?)... |
Are you sure about the XOR requirement? I thought a 'block check' (at least
in comms) was just the modulo 256 sum of all the characters in the message.
The mod 256 is done to extract the least significant byte. The result would
normally be displayed as two hex digits. So... The string "ABCDE" would be:
65 + 66 + 67 + 68 + 69 = 335, so the BCC is MOD(335, 256) = 79 (or 4F in
hex)
Of course, I may be way out on this ...