Hex-Binary conversion
Posted: Fri Feb 06, 2009 8:55 pm
I am working on a project that involves parsing some XML that includes file permission information that has been encoded using a bitmask. The bit mask has been converted into hexidecimal for inclusion in the xml files.
What I would like to be able to do is read the xml file and decode the hexidecimal into zeros and ones, from which I can then translate the flipped bits the file permissions.
I have been trying to figure out how to do this using the binarydecode function, but I think I am totally on the wrong track - it is converting the characters to binary, but since I can't figure out how to tell it that the input is hex it's spitting back the 8 bit's that represent the character rather than the 4 bits represented by the hex number that I want...
Is there a way to do this? I am obviously terrible at real computer stuff.
What I would like to be able to do is read the xml file and decode the hexidecimal into zeros and ones, from which I can then translate the flipped bits the file permissions.
I have been trying to figure out how to do this using the binarydecode function, but I think I am totally on the wrong track - it is converting the characters to binary, but since I can't figure out how to tell it that the input is hex it's spitting back the 8 bit's that represent the character rather than the 4 bits represented by the hex number that I want...
Is there a way to do this? I am obviously terrible at real computer stuff.