Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now
3 of 3 added 302 characters in body

Convert the number into hex than use echo to print the according byte sequence and pipe that into base64. So to encode the integer 10 with base64, you can use:

echo -en '\xA' | base64

To explain the result. The byte 10 has the following binary representation:


What base64 does is, it chunks those into groups of 6 bits. So with padding we get the following two 6lets:

000010 100000

Which in decimal are 2 and 32, which correspond to the letters C and g.