JD2022-TU1/main/extern/dtest/dtcore/inc/dtbase64.h

26 lines
626 B
C++

#pragma once
#include "dtcore/inc/dtdefinitions.h"
namespace dt
{
class ByteBuffer;
class String;
class Base64
{
public:
DT_CORE_DLL_ENTRY static void Encode(const ByteBuffer& in, String& out);
DT_CORE_DLL_ENTRY static bool Decode(const String& in, ByteBuffer& out);
private:
static SizeT EncodedLength(SizeT length);
static SizeT DecodedLength(const String& in);
static void A3ToA4(unsigned char * a4, unsigned char * a3);
static void A4ToA3(unsigned char * a3, unsigned char * a4);
static unsigned char Lookup(unsigned char c);
};
}