FYI, it seems to be known as this: http://en.wikipedia.org/wiki/Base64#URL_applications
Base64 encoding also seems to result in quite long ascii strings compared to what I threw together.
Or is there a way to use Base64 which would give results of a comparable length?
As wikipedia says, padding can be added or removed as a matter of taste: From a theoretical point of view the padding character is not needed, since the number of missing bytes can be calculated from the number of base64 digits.