#pragma once #include "EHS.h" #include "Str.h" namespace ehs { class EHS_LIB_IO Base64 { private: static constexpr UInt_8 asciiUrl[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; static constexpr UInt_8 ascii[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; public: static Str_8 EncodeURL(const Str_8 &input); static Str_8 Encode(const Str_8 &input); static Str_8 DecodeURL(const Str_8 &input); static Str_8 Decode(const Str_8 &input); private: static UInt_8 FindURL(const UInt_8 &c); static UInt_8 Find(const UInt_8 &c); static bool IsBase64URL(const UInt_8 &c); static bool IsBase64(const UInt_8 &c); }; }