Implement web safe base64 encoding and decoding