I want to convert a simple HEX string such as 10000000000002ae to Base 64.
The hex string is to be converted to bytes, and the bytes are then encoded to base64 notation,
Python 2 has native support for both HEX and base64 encoding:
encoded = HEX_STRING.decode("hex").encode("base64")
(if you are using Python 3, see Eana Hufwe or Ali's answers instead)