pub fn encode_b64_json<T>(data: &T) -> Result<String>where T: Serialize,
Serialize the given data into JSON and encode the result in url-safe base64.