import base64


def Base64EncodeProto(msg):
  """ Encodes the proto as a base64 string which is safe to pass around on command line. """
  encoded_string = base64.b64encode(msg.SerializeToString())
  return encoded_string