Hi, i am trying to encode magnetic cards with basic membership info. But to encode i need to add the 'Longitudinal redundency check character' to the end of the string? An example can be seen at
http://search.cpan.org/~whoelse/String-LRC-1.01/LRC.pod
I need a version that i can enter the membership info in a visubal basic6 program and it can find the lrc from the string. Seems simple enough but no examples anywhere.
I also have the info:-
Take a string that has to be LRC and do the following.
For each character, convert it to binary form and binary xor with the next character in the string. Take that answer and binary xor with the next character. etc until done with the string.
Then convert the binary back to decimal or hex.
When converting to binary, pad the beginning of the string with "0"'s to get your 8 bits. This is important when using normally printer characters - in PHP they come out as 6 or 7 bits after the conversion.
A binary XOR (or binary add) is when both elements are 1 or 0, then the result is 0, otherwise the result is 1.
0101010
0110110
0011100
I simply need the 1 character that is the LRC. Any help would be great
Thanks
Jules@hungrybear.co.uk