Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xor and checksum problem

Status
Not open for further replies.

norason

Programmer
Jan 28, 2009
139
0
0
US
I am reading a string file comprised of HEX values followed by a checksum and an EOF string: Note that there is no comma before the ckecksum)

01,03,A3,0A,7C<checksum>ZZ

From what I've read, I need to relace the commas with spaces, get the VAL of the data, then perfom a cumulative XOR on the file - is this correct?

I need to verify the data, so I plan to use XOR on all the data and the checksum (Not the EOF string).


When I'm done, the value should be 0 - correct?

I'm not asking for code - just verification of my plan.

Thanks,

Gary





 
You probably should be looking for actual code for the checksum. It is not quite as simple as XORing each byte. Search almost everwhere to find actual code (even with comments on how / what the code is doing) are available in numeros locations (via google / yahoo / your favorite search enging).



MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top