base641.h

来自「Sniffer using Sock_raw. 挺不错的。」· C头文件 代码 · 共 57 行

H
57
字号
/*==========================================================================
   ASCII---->base64 source code
       powered by shadow
        @2004.10.4 01:01
web:http://www.codehome.6600.org
info:
     sperated by 6 bits:
-----Base64 code table:
-----0-25--> 'A"-'Z'   26-51-->'a'-'z'   52-61-->'0'-'9' 62-->'+'  63-->'/'
============================================================================*/

#if !defined(AFX_BASE641_H__11427255_4FE0_4D28_9AF5_70A5F8701068__INCLUDED_)
#define AFX_BASE641_H__11427255_4FE0_4D28_9AF5_70A5F8701068__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define MaxLen 741
#define DeMaxLen 1014
class BASE64  
{
public:
	int FileDecode(char * fromfile,char * tofile);
	char * StringDecode(unsigned char *p);
	void Reset();
	char * GetLastError();
	int FileEncode(char *fromfile,char *tofile);
	char * StringEncode(unsigned char *p);
	BASE64();
	virtual ~BASE64();

private:
	void decode_2();
	void decode_4();
	void decode_3();
	void file_decode(FILE *fp);
	//
	void file_encode(FILE *fp);
	void encode_3();
	void encode_2();
	void encode_1();
	void put(unsigned char ch);
	FILE * fp_in;
	FILE * fp_out;
	bool StrEncode;
	bool StrDecode;
	unsigned char code[3];
	unsigned char decode[5];
    int length;
	char *base64_str;
	char Base64Str[1015];
	int errorcode;
    char *Base64Error[3];
};

#endif // !defined(AFX_BASE641_H__11427255_4FE0_4D28_9AF5_70A5F8701068__INCLUDED_)

⌨️ 快捷键说明

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