Z Zaeed New Member Apr 22, 2009 #1 Hi, I'm trying to perform a checksum on my RFID tag. I have an array with the 5 bytes that make up my RFID and a 6th that is the checksum. I have to XOR the 5 bytes and check if they equal the 6th.. How do I do this? I can't figure it out Thanks
Hi, I'm trying to perform a checksum on my RFID tag. I have an array with the 5 bytes that make up my RFID and a 6th that is the checksum. I have to XOR the 5 bytes and check if they equal the 6th.. How do I do this? I can't figure it out Thanks
P Pommie Well-Known Member Most Helpful Member Apr 22, 2009 #2 Just XOR all 6 bytes together and the result should be zero. Mike.
felis New Member Apr 23, 2009 #4 Zaeed said: But what is the code to do this? Click to expand... Depends on a language. That's how it would look in Fortran: Code: XOr(I, J) Which one are you using?
Zaeed said: But what is the code to do this? Click to expand... Depends on a language. That's how it would look in Fortran: Code: XOr(I, J) Which one are you using?
felis New Member Apr 23, 2009 #6 in C, the operator is ^. To XOR a and b you write: Code: a = a^b; or Code: a ^= b; Last edited: Apr 23, 2009