EHS/include/ehs/Base64.h
Karutoh bce48fe121
All checks were successful
Build & Release / Windows-AMD64-Build (push) Successful in 6m9s
Build & Release / Linux-AMD64-Build (push) Successful in 15m26s
Build & Release / Linux-AARCH64-Build (push) Successful in 45m54s
Fixed "System::OpenURI". Added SHA256. Added URI safe Base64 methods.
2025-05-11 19:43:50 -07:00

33 lines
697 B
C++

#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);
};
}