You can do this by two method fist , u know that1 hex digit can be easily converted into binary with 4 bit so u can convert whole message in binary and then do whatever u want . Second u can convert hex into decimal then apply opertion but this is lenthy process