The Stack Overflow podcast is back! Listen to an interview with our new CEO.
2 of 3 added 1 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