base64.h

来自「对字符串进行base64编码和解码; 在http传输中」· C头文件 代码 · 共 42 行

H
42
字号
// Base64.h: interface for the Base64 class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_BASE64_H__D1CE45BE_2DDD_47A2_9777_CA3BA8A42AE4__INCLUDED_)
#define AFX_BASE64_H__D1CE45BE_2DDD_47A2_9777_CA3BA8A42AE4__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <afx.h>

class CBase64
{
public:

	// 将ANSI字符串转成Base64字符串
	static CString encode(const CString in_str);
	static void encode(LPSTR pIn, DWORD dwInLen, LPSTR pOut, LPDWORD pdwOutLen);

	// 将Base64字符串转成ANSI字符串
	static CString decode(const CString in_str);
	static void decode(LPSTR pIn, DWORD dwInLen, LPSTR pOut, LPDWORD pdwOutLen);


private:

	// encode table(编码表)
	const static CString _base64_encode_chars;

	// decode table(解码表)
	const static char _base64_decode_chars[128];


};


#endif // !defined(AFX_BASE64_H__D1CE45BE_2DDD_47A2_9777_CA3BA8A42AE4__INCLUDED_)


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?