The Stack Overflow podcast is back! Listen to an interview with our new CEO.
1 of 3

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 -n '\xA' | base64