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.
Hex-Binary conversion
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 179
- Joined: Sat Apr 08, 2006 11:08 pm
- Contact:
As Mark suggests, it's often easier to give good answers when we can se the context, but baseconvert() may be your best bet here...
If tHexString were 'fc1b', the output would be '1111110000011011'
Code: Select all
put baseconvert(tHexString, 16, 2) into tBitString
If tHexString were 'fc1b', the output would be '1111110000011011'