#pragma once

#include <string>
#include <vector>

class EncodeAndDecodeUtils {
public:
    // Decode Base64 + GZip -> UTF8 string
    static std::string UnEncodeAndUnGzipString(const std::string& encodedToken);

    // GZip compress UTF8 string and then Base64 encode
    static std::string GzipAndBase64EncodeString(const std::string& json);

    // Normalize EOL and remove extra blank lines produced by gzip/unix conversions
    static std::string FixupGzipEolCraziness(const std::string& newJsonText);

private:
    static std::string Base64Encode(const std::vector<unsigned char>& data);
    static std::vector<unsigned char> Base64Decode(const std::string& input);
};

