Author Topic: Algorithm for XML Checksum?  (Read 3162 times)

nikku

  • Newbie
  • *
  • Posts: 8
    • View Profile
Algorithm for XML Checksum?
« on: March 14, 2013, 06:31:26 am »
Hey there!
I was reading through the documentation for the XML Communication protocol, and noticed that there must be a checksum for the payload included in the wrapper, but couldn't see how this checksum is calculated.
For instance, is it a CRC32 checksum? Or is it an 8-bit two's complement checksum like the touchscreen communication?
Thanks!

iostream212

  • Sr. Member
  • ****
  • Posts: 459
    • View Profile
Re: Algorithm for XML Checksum?
« Reply #1 on: March 14, 2013, 10:25:37 am »
Hi! Welcome to the forums. Without testing I would guess two's compliment, but that is only a guess. I can't test it at the moment, but could probably work on it tonight or tomorrow and get an answer for you.
I always wanted to be somebody. In retrospect, I think I should have been more specific.

iostream212

  • Sr. Member
  • ****
  • Posts: 459
    • View Profile
Re: Algorithm for XML Checksum?
« Reply #2 on: March 14, 2013, 03:53:21 pm »
Well so much for testing... I was getting replies from the xml service no matter what I had as the checksum. Even empty and non-numeric checksum values worked.
I always wanted to be somebody. In retrospect, I think I should have been more specific.

nikku

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Algorithm for XML Checksum?
« Reply #3 on: March 15, 2013, 03:27:38 am »
Thank you for the welcome! Admittedly I also did not test it yet, I was pseudo coding up a project and wondered what it was haha. Do you think I should code my project using 2's complement for now just to be safe? (i could likely easily change it later without much issue I imagine)
I'm also curious if the length will matter and what it's based on (length of the Bytes or length of the actual XML string), but I can probably figure that out pretty easily through some testing.
Thanks for your quick reply and help!
« Last Edit: March 15, 2013, 05:38:19 am by nikku »

iostream212

  • Sr. Member
  • ****
  • Posts: 459
    • View Profile
Re: Algorithm for XML Checksum?
« Reply #4 on: March 15, 2013, 06:04:06 am »
Sure thing! Length was the number of characters in the request string. Basically everything but the wrapper. Happy coding!

Sent from my Galaxy Nexus using Tapatalk 2

I always wanted to be somebody. In retrospect, I think I should have been more specific.