I have some string representing a number in hex and I want to convert it to base-64. How do I do this and how does this suggestion work? As I need to have an understanding of how it works.
The first thing I thought of was (I'm a noob) implementing a simple algorithm that would proceed as one would when working with pen and paper, though I imagine Python has this sort of stuff "built-in".
I can implement this through searching on the internet however I need an understanding of how it works.
Some sample questions to give you an idea of the explanations I need:
- If your answer requires strings of the type
b'...'
could you please explain what they are and why doesb64encode()
seems to only accept objects of this type as arguments? - Why does
int()
only work up to base-36 and how can I in general handle conversion between different bases tidily and could you give a further explanation if your solution involves this function?
So if anyone could give me some pointers here. I am not being able to extract much from the documentation as this type of knowledge seems to be already expected.
Thanks.