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