b64 encoding optimization