This is BASE64 encoding, as currently described in RFC-4648.
For whatever language you're using, just look up base64 in that language's standard library; you should find it.