mFrame
載入中...
搜尋中...
無符合項目
Base64.h
1
7#ifndef UTIL_E64A0B4D_6CC3_4D86_9DA5_46D2D7103982
8#define UTIL_E64A0B4D_6CC3_4D86_9DA5_46D2D7103982
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15
16//----------------------------------------------------------------------------------------
17#include "./../lang/Object.h"
18
19/* ***************************************************************************************
20 * Namespace
21 */
22namespace ufm::util {
23 class Base64;
24} // namespace ufm::util
25
26/* ***************************************************************************************
27 * Class/Interface/Struct/Enum
28 */
29
100 /* *************************************************************************************
101 * Variable
102 */
103 public:
105 const uint8 mPiexl[256] = {
106 /* ASCII table */
107 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
108 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
109 64, 64, 64, 62, 64, 64, 64, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64,
110 64, 64, 64, 64, 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
111 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64, 64, 26, 27, 28,
112 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
113 49, 50, 51, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
114 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
115 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
116 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
117 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
118 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
119 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64};
120
122 const char mTable[65] =
123 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
124
125 /* *************************************************************************************
126 * Abstract Method
127 */
128
129 /* *************************************************************************************
130 * Construct Method
131 */
132 public:
138 Base64(void);
139
145 virtual ~Base64(void) override;
146
147 /* *************************************************************************************
148 * Operator Method
149 */
150
151 /* *************************************************************************************
152 * Override Method
153 */
154
155 /* *************************************************************************************
156 * Public Method
157 */
158 public:
170 int encode(const void* src, int srcLen, void* dst, int dstLen);
171
180 int encodeLen(int len);
181
192 int decode(const char* src, void* dst, int dstLen);
193
202 int decodeLen(const char* src);
203
204 /* *************************************************************************************
205 * Protected Method
206 */
207
208 /* *************************************************************************************
209 * Private Method
210 */
211
212 /* *************************************************************************************
213 * Static Variable
214 */
215
216 /* *************************************************************************************
217 * Static Method
218 */
219};
220
221/* ***************************************************************************************
222 * End of file
223 */
224
225#endif /* UTIL_E64A0B4D_6CC3_4D86_9DA5_46D2D7103982 */
物件基底類別
Definition Object.h:63
Base64 編碼/解碼實用類別,提供標準 Base64 演算法實作。
Definition Base64.h:99
int decode(const char *src, void *dst, int dstLen)
將Base64編碼數據解碼為原始數據
virtual ~Base64(void) override
銷毀Base64對象
const uint8 mPiexl[256]
ASCII 解碼表,將 Base64 字元對應到數值 (0-63),無效字元為 64。
Definition Base64.h:105
int encodeLen(int len)
計算Base64編碼後的長度
int decodeLen(const char *src)
計算Base64解碼後的長度
int encode(const void *src, int srcLen, void *dst, int dstLen)
將數據編碼為Base64格式
const char mTable[65]
Base64 編碼字元表,包含 64 個字元: A-Z, a-z, 0-9, +, /。
Definition Base64.h:122
Base64(void)
構造一個新的Base64編碼/解碼器
Definition Iterable.h:28