I know how to convert hexadecimals to integers when i only have one hexadecimal character. but im getting a string of two characters.
I'm converting both characters to hex with:
String.Format("{0:x2}", (uint)System.Convert.ToUInt32(tmp.ToString()))
so then lets say i have 01, and 3f as my two length characters. how am i supposed to convert those to integer? i tried doing
int length = int.Parse("013f", System.Globalization.NumberStyles.AllowHexSpecifier);
but apparently that is incorrect. i even took the values of both of those, Concat'd them together, and then tried to parse them.. that obviously was not right
am i doing something wrong trying to parse these two hexadecimals into a length, or is the server im getting the information from using a non-standard length system. because i can get the correct lengths when the first character is 00, like 0001 or something. im just not sure about when i have two length characters.
EDIT: after some trial and error, the expected value is 491
Update number two:
Basically the server provides me with a two character long string, that tells you the length of the following data.
the two characters for this specific attribute are 01, and 3f. the following data is 491 characters long, which as far as i can see, has no relation to 013f what-so-ever, but i know there is one somewhere, because another application is using this exact same data but coming out with the correct results.