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 has native support for both HEX and base64 encoding:
import base64 def main(): b16 = bytearray('10000000000002ae'.decode('hex')) b64 = base64.b64encode(b16) print b64