fastdo  0.6.16
encoding.hpp
浏览该文件的文档.
1 #ifndef __ENCODING_HPP__
2 #define __ENCODING_HPP__
3 //
4 // encoding 提供编码与解码相关的功能
5 //
6 
7 namespace winux
8 {
15 template < typename _ChTy >
16 XString<_ChTy> UrlEncode( void const * buf, size_t size );
17 template <>
18 WINUX_FUNC_DECL(XString<char>) UrlEncode( void const * buf, size_t size );
19 template <>
20 WINUX_FUNC_DECL(XString<wchar>) UrlEncode( void const * buf, size_t size );
21 template <>
22 WINUX_FUNC_DECL(XString<char16>) UrlEncode( void const * buf, size_t size );
23 template <>
24 WINUX_FUNC_DECL(XString<char32>) UrlEncode( void const * buf, size_t size );
25 
26 template < typename _ChTy >
27 inline XString<_ChTy> UrlEncode( AnsiString const & data ) { return UrlEncode<_ChTy>( data.c_str(), data.length() ); }
28 template < typename _ChTy >
29 inline XString<_ChTy> UrlEncodeBuffer( Buffer const & buf ) { return UrlEncode<_ChTy>( buf.getBuf(), buf.getSize() ); }
30 
31 #if defined(_UNICODE) || defined(UNICODE)
32 inline UnicodeString UrlEncode( void const * buf, size_t size ) { return UrlEncode<wchar>( buf, size ); }
33 inline UnicodeString UrlEncode( AnsiString const & data ) { return UrlEncode<wchar>( data.c_str(), data.length() ); }
34 inline UnicodeString UrlEncodeBuffer( Buffer const & buf ) { return UrlEncode<wchar>( buf.getBuf(), buf.getSize() ); }
35 #else
36 inline AnsiString UrlEncode( void const * buf, size_t size ) { return UrlEncode<char>( buf, size ); }
37 inline AnsiString UrlEncode( AnsiString const & data ) { return UrlEncode<char>( data.c_str(), data.length() ); }
38 inline AnsiString UrlEncodeBuffer( Buffer const & buf ) { return UrlEncode<char>( buf.getBuf(), buf.getSize() ); }
39 #endif
40 
41 
43 template < typename _ChTy >
44 AnsiString UrlDecode( XString<_ChTy> const & encodedStr );
45 template <>
46 WINUX_FUNC_DECL(AnsiString) UrlDecode( XString<char> const & encodedStr );
47 template <>
48 WINUX_FUNC_DECL(AnsiString) UrlDecode( XString<wchar> const & encodedStr );
49 template <>
51 template <>
53 
55 template < typename _ChTy >
56 Buffer UrlDecodeBuffer( XString<_ChTy> const & encodedStr );
57 template <>
59 template <>
61 template <>
63 template <>
65 
66 #if defined(_UNICODE) || defined(UNICODE)
67 inline AnsiString UrlDecode( UnicodeString const & encodedStr ) { return UrlDecode<wchar>(encodedStr); }
68 inline Buffer UrlDecodeBuffer( UnicodeString const & encodedStr ) { return UrlDecodeBuffer<wchar>(encodedStr); }
69 #else
70 inline AnsiString UrlDecode( AnsiString const & encodedStr ) { return UrlDecode<char>(encodedStr); }
71 inline Buffer UrlDecodeBuffer( AnsiString const & encodedStr ) { return UrlDecodeBuffer<char>(encodedStr); }
72 #endif
73 
74 
79 template < typename _ChTy >
80 XString<_ChTy> UriComponentEncode( void const * buf, size_t size );
81 template <>
82 WINUX_FUNC_DECL(XString<char>) UriComponentEncode( void const * buf, size_t size );
83 template <>
84 WINUX_FUNC_DECL(XString<wchar>) UriComponentEncode( void const * buf, size_t size );
85 template <>
86 WINUX_FUNC_DECL(XString<char16>) UriComponentEncode( void const * buf, size_t size );
87 template <>
88 WINUX_FUNC_DECL(XString<char32>) UriComponentEncode( void const * buf, size_t size );
89 
90 template < typename _ChTy >
91 inline XString<_ChTy> UriComponentEncode( AnsiString const & data ) { return UriComponentEncode<_ChTy>( data.c_str(), data.length() ); }
92 template < typename _ChTy >
93 inline XString<_ChTy> UriComponentEncodeBuffer( Buffer const & buf ) { return UriComponentEncode<_ChTy>( buf.getBuf(), buf.getSize() ); }
94 
95 #if defined(_UNICODE) || defined(UNICODE)
96 inline UnicodeString UriComponentEncode( void const * buf, size_t size ) { return UriComponentEncode<wchar>( buf, size ); }
97 inline UnicodeString UriComponentEncode( AnsiString const & data ) { return UriComponentEncode<wchar>( data.c_str(), data.length() ); }
98 inline UnicodeString UriComponentEncodeBuffer( Buffer const & buf ) { return UriComponentEncode<wchar>( buf.getBuf(), buf.getSize() ); }
99 #else
100 inline AnsiString UriComponentEncode( void const * buf, size_t size ) { return UriComponentEncode<char>( buf, size ); }
101 inline AnsiString UriComponentEncode( AnsiString const & data ) { return UriComponentEncode<char>( data.c_str(), data.length() ); }
102 inline AnsiString UriComponentEncodeBuffer( Buffer const & buf ) { return UriComponentEncode<char>( buf.getBuf(), buf.getSize() ); }
103 #endif
104 
105 
107 template < typename _ChTy >
108 AnsiString UriComponentDecode( XString<_ChTy> const & encodedStr );
109 template <>
111 template <>
113 template <>
115 template <>
117 
119 template < typename _ChTy >
120 Buffer UriComponentDecodeBuffer( XString<_ChTy> const & encodedStr );
121 template <>
123 template <>
125 template <>
127 template <>
129 
130 #if defined(_UNICODE) || defined(UNICODE)
131 inline AnsiString UriComponentDecode( UnicodeString const & encodedStr ) { return UriComponentDecode<wchar>(encodedStr); }
132 inline Buffer UriComponentDecodeBuffer( UnicodeString const & encodedStr ) { return UriComponentDecodeBuffer<wchar>(encodedStr); }
133 #else
134 inline AnsiString UriComponentDecode( AnsiString const & encodedStr ) { return UriComponentDecode<char>(encodedStr); }
135 inline Buffer UriComponentDecodeBuffer( AnsiString const & encodedStr ) { return UriComponentDecodeBuffer<char>(encodedStr); }
136 #endif
137 
138 
140 WINUX_FUNC_DECL(String) UrlEncodeString( String const & str, bool asUtf8 = sizeof(String::value_type) == sizeof(wchar) );
141 
143 WINUX_FUNC_DECL(String) UrlDecodeString( String const & encodedStr, bool isUtf8 = sizeof(String::value_type) == sizeof(wchar) );
144 
145 
147 WINUX_FUNC_DECL(String) UriComponentEncodeString( String const & str, bool asUtf8 = sizeof(String::value_type) == sizeof(wchar) );
148 
150 WINUX_FUNC_DECL(String) UriComponentDecodeString( String const & encodedStr, bool isUtf8 = sizeof(String::value_type) == sizeof(wchar) );
151 
152 
154 WINUX_FUNC_DECL(String) HtmlEncode( String const & str );
155 
157 WINUX_FUNC_DECL(String) HtmlDecode( String const & str );
158 
159 
161 template < typename _ChTy >
162 XString<_ChTy> Base64Encode( void const * buf, size_t size );
163 template <>
164 WINUX_FUNC_DECL(XString<char>) Base64Encode( void const * buf, size_t size );
165 template <>
166 WINUX_FUNC_DECL(XString<wchar>) Base64Encode( void const * buf, size_t size );
167 template <>
168 WINUX_FUNC_DECL(XString<char16>) Base64Encode( void const * buf, size_t size );
169 template <>
170 WINUX_FUNC_DECL(XString<char32>) Base64Encode( void const * buf, size_t size );
171 
173 template < typename _ChTy >
174 inline XString<_ChTy> Base64Encode( AnsiString const & data ) { return Base64Encode<_ChTy>( data.c_str(), data.length() ); }
175 
177 template < typename _ChTy >
178 inline XString<_ChTy> Base64EncodeBuffer( Buffer const & buf ) { return Base64Encode<_ChTy>( buf.getBuf(), buf.getSize() ); }
179 
181 #if defined(_UNICODE) || defined(UNICODE)
182 inline UnicodeString Base64Encode( void const * buf, size_t size ) { return Base64Encode<wchar>( buf, size ); }
183 inline UnicodeString Base64Encode( AnsiString const & data ) { return Base64Encode<wchar>( data.c_str(), data.length() ); }
184 inline UnicodeString Base64EncodeBuffer( Buffer const & buf ) { return Base64Encode<wchar>( buf.getBuf(), buf.getSize() ); }
185 #else
186 inline AnsiString Base64Encode( void const * buf, size_t size ) { return Base64Encode<char>( buf, size ); }
187 inline AnsiString Base64Encode( AnsiString const & data ) { return Base64Encode<char>( data.c_str(), data.length() ); }
188 inline AnsiString Base64EncodeBuffer( Buffer const & buf ) { return Base64Encode<char>( buf.getBuf(), buf.getSize() ); }
189 #endif
190 
191 
193 template < typename _ChTy >
194 AnsiString Base64Decode( XString<_ChTy> const & base64Str );
195 template <>
197 template <>
199 template <>
201 template <>
203 
204 
206 template < typename _ChTy >
207 Buffer Base64DecodeBuffer( XString<_ChTy> const & base64Str );
208 template <>
210 template <>
212 template <>
214 template <>
216 
218 #if defined(_UNICODE) || defined(UNICODE)
219 inline AnsiString Base64Decode( UnicodeString const & base64Str ) { return Base64Decode<wchar>(base64Str); }
220 inline Buffer Base64DecodeBuffer( UnicodeString const & base64Str ) { return Base64DecodeBuffer<wchar>(base64Str); }
221 #else
222 inline AnsiString Base64Decode( AnsiString const & base64Str ) { return Base64Decode<char>(base64Str); }
223 inline Buffer Base64DecodeBuffer( AnsiString const & base64Str ) { return Base64DecodeBuffer<char>(base64Str); }
224 #endif
225 
226 
228 template < typename _ChTy >
229 XString<_ChTy> BufferToHex( Buffer const & buf );
230 template <>
232 template <>
234 template <>
236 template <>
238 
240 #if defined(_UNICODE) || defined(UNICODE)
241 inline UnicodeString BufferToHex( Buffer const & buf ) { return BufferToHex<wchar>(buf); }
242 #else
243 inline AnsiString BufferToHex( Buffer const & buf ) { return BufferToHex<char>(buf); }
244 #endif
245 
246 
248 template < typename _ChTy >
249 Buffer HexToBuffer( XString<_ChTy> const & hexStr );
250 template <>
252 template <>
254 template <>
256 template <>
258 
260 #if defined(_UNICODE) || defined(UNICODE)
261 inline Buffer HexToBuffer( UnicodeString const & hexStr ) { return HexToBuffer<wchar>(hexStr); }
262 #else
263 inline Buffer HexToBuffer( AnsiString const & hexStr ) { return HexToBuffer<char>(hexStr); }
264 #endif
265 
266 
268 WINUX_FUNC_DECL(Buffer) Md5( void const * buf, size_t size );
270 inline Buffer Md5( Buffer const & buf ) { return Md5( buf.getBuf(), buf.getSize() ); }
271 
273 template < typename _ChTy >
274 inline XString<_ChTy> Md5Hex( void const * buf, size_t size ) { return BufferToHex<_ChTy>( Md5( buf, size ) ); }
276 template < typename _ChTy >
277 inline XString<_ChTy> Md5Hex( Buffer const & buf ) { return Md5Hex<_ChTy>( buf.getBuf(), buf.getSize() ); }
278 
280 #if defined(_UNICODE) || defined(UNICODE)
281 inline UnicodeString Md5Hex( void const * buf, size_t size ) { return BufferToHex<wchar>( Md5( buf, size ) ); }
282 inline UnicodeString Md5Hex( Buffer const & buf ) { return Md5Hex<wchar>( buf.getBuf(), buf.getSize() ); }
283 #else
284 inline AnsiString Md5Hex( void const * buf, size_t size ) { return BufferToHex<char>( Md5( buf, size ) ); }
285 inline AnsiString Md5Hex( Buffer const & buf ) { return Md5Hex<char>( buf.getBuf(), buf.getSize() ); }
286 #endif
287 
288 
290 WINUX_FUNC_DECL(Buffer) Sha1( void const * buf, size_t size );
292 inline Buffer Sha1( Buffer const & buf ) { return Sha1( buf.getBuf(), buf.getSize() ); }
293 
295 template < typename _ChTy >
296 inline XString<_ChTy> Sha1Hex( void const * buf, size_t size ) { return BufferToHex<_ChTy>( Sha1( buf, size ) ); }
298 template < typename _ChTy >
299 inline XString<_ChTy> Sha1Hex( Buffer const & buf ) { return Sha1Hex<_ChTy>( buf.getBuf(), buf.getSize() ); }
300 
302 #if defined(_UNICODE) || defined(UNICODE)
303 inline UnicodeString Sha1Hex( void const * buf, size_t size ) { return BufferToHex<wchar>( Sha1( buf, size ) ); }
304 inline UnicodeString Sha1Hex( Buffer const & buf ) { return Sha1Hex<wchar>( buf.getBuf(), buf.getSize() ); }
305 #else
306 inline AnsiString Sha1Hex( void const * buf, size_t size ) { return BufferToHex<char>( Sha1( buf, size ) ); }
307 inline AnsiString Sha1Hex( Buffer const & buf ) { return Sha1Hex<char>( buf.getBuf(), buf.getSize() ); }
308 #endif
309 
310 
312 WINUX_FUNC_DECL(Buffer) Sha224( void const * buf, size_t size );
314 inline Buffer Sha224( Buffer const & buf ) { return Sha224( buf.getBuf(), buf.getSize() ); }
315 
317 template < typename _ChTy >
318 inline XString<_ChTy> Sha224Hex( void const * buf, size_t size ) { return BufferToHex<_ChTy>( Sha224( buf, size ) ); }
320 template < typename _ChTy >
321 inline XString<_ChTy> Sha224Hex( Buffer const & buf ) { return Sha224Hex<_ChTy>( buf.getBuf(), buf.getSize() ); }
322 
324 #if defined(_UNICODE) || defined(UNICODE)
325 inline UnicodeString Sha224Hex( void const * buf, size_t size ) { return BufferToHex<wchar>( Sha224( buf, size ) ); }
326 inline UnicodeString Sha224Hex( Buffer const & buf ) { return Sha224Hex<wchar>( buf.getBuf(), buf.getSize() ); }
327 #else
328 inline AnsiString Sha224Hex( void const * buf, size_t size ) { return BufferToHex<char>( Sha224( buf, size ) ); }
329 inline AnsiString Sha224Hex( Buffer const & buf ) { return Sha224Hex<char>( buf.getBuf(), buf.getSize() ); }
330 #endif
331 
332 
334 WINUX_FUNC_DECL(Buffer) Sha256( void const * buf, size_t size );
336 inline Buffer Sha256( Buffer const & buf ) { return Sha256( buf.getBuf(), buf.getSize() ); }
337 
339 template < typename _ChTy >
340 inline XString<_ChTy> Sha256Hex( void const * buf, size_t size ) { return BufferToHex<_ChTy>( Sha256( buf, size ) ); }
342 template < typename _ChTy >
343 inline XString<_ChTy> Sha256Hex( Buffer const & buf ) { return Sha256Hex<_ChTy>( buf.getBuf(), buf.getSize() ); }
344 
346 #if defined(_UNICODE) || defined(UNICODE)
347 inline UnicodeString Sha256Hex( void const * buf, size_t size ) { return BufferToHex<wchar>( Sha256( buf, size ) ); }
348 inline UnicodeString Sha256Hex( Buffer const & buf ) { return Sha256Hex<wchar>( buf.getBuf(), buf.getSize() ); }
349 #else
350 inline AnsiString Sha256Hex( void const * buf, size_t size ) { return BufferToHex<char>( Sha256( buf, size ) ); }
351 inline AnsiString Sha256Hex( Buffer const & buf ) { return Sha256Hex<char>( buf.getBuf(), buf.getSize() ); }
352 #endif
353 
354 
356 WINUX_FUNC_DECL(Buffer) Sha384( void const * buf, size_t size );
358 inline Buffer Sha384( Buffer const & buf ) { return Sha384( buf.getBuf(), buf.getSize() ); }
359 
361 template < typename _ChTy >
362 inline XString<_ChTy> Sha384Hex( void const * buf, size_t size ) { return BufferToHex<_ChTy>( Sha384( buf, size ) ); }
364 template < typename _ChTy >
365 inline XString<_ChTy> Sha384Hex( Buffer const & buf ) { return Sha384Hex<_ChTy>( buf.getBuf(), buf.getSize() ); }
366 
368 #if defined(_UNICODE) || defined(UNICODE)
369 inline UnicodeString Sha384Hex( void const * buf, size_t size ) { return BufferToHex<wchar>( Sha384( buf, size ) ); }
370 inline UnicodeString Sha384Hex( Buffer const & buf ) { return Sha384Hex<wchar>( buf.getBuf(), buf.getSize() ); }
371 #else
372 inline AnsiString Sha384Hex( void const * buf, size_t size ) { return BufferToHex<char>( Sha384( buf, size ) ); }
373 inline AnsiString Sha384Hex( Buffer const & buf ) { return Sha384Hex<char>( buf.getBuf(), buf.getSize() ); }
374 #endif
375 
376 
378 WINUX_FUNC_DECL(Buffer) Sha512( void const * buf, size_t size );
380 inline Buffer Sha512( Buffer const & buf ) { return Sha512( buf.getBuf(), buf.getSize() ); }
381 
383 template < typename _ChTy >
384 inline XString<_ChTy> Sha512Hex( void const * buf, size_t size ) { return BufferToHex<_ChTy>( Sha512( buf, size ) ); }
386 template < typename _ChTy >
387 inline XString<_ChTy> Sha512Hex( Buffer const & buf ) { return Sha512Hex<_ChTy>( buf.getBuf(), buf.getSize() ); }
388 
390 #if defined(_UNICODE) || defined(UNICODE)
391 inline UnicodeString Sha512Hex( void const * buf, size_t size ) { return BufferToHex<wchar>( Sha512( buf, size ) ); }
392 inline UnicodeString Sha512Hex( Buffer const & buf ) { return Sha512Hex<wchar>( buf.getBuf(), buf.getSize() ); }
393 #else
394 inline AnsiString Sha512Hex( void const * buf, size_t size ) { return BufferToHex<char>( Sha512( buf, size ) ); }
395 inline AnsiString Sha512Hex( Buffer const & buf ) { return Sha512Hex<char>( buf.getBuf(), buf.getSize() ); }
396 #endif
397 
398 
401 {
405 };
406 
408 WINUX_FUNC_DECL(int) RawEncrypt( byte const * data, size_t dataSize, byte * buf, size_t bufSize, size_t * outSize );
410 WINUX_FUNC_DECL(int) RawDecrypt( byte const * encryptData, size_t dataSize, byte * buf, size_t bufSize, size_t * outSize );
411 
415 WINUX_FUNC_DECL(Buffer) EncryptContent( Buffer const & content );
417 WINUX_FUNC_DECL(AnsiString) DecryptContent( AnsiString const & encryptContent );
419 WINUX_FUNC_DECL(Buffer) DecryptContent( Buffer const & encryptContent );
420 
421 #define EncryptCArray(data) EncryptContent( CBufferToAnsiString( data, sizeof(data) ) )
422 #define EncryptCBuffer( buf, size ) EncryptContent( CBufferToAnsiString( buf, size ) )
423 #define DecryptCArray(data) DecryptContent( CBufferToAnsiString( data, sizeof(data) ) )
424 #define DecryptCBuffer( buf, size ) DecryptContent( CBufferToAnsiString( buf, size ) )
425 
426 
427 } // namespace winux
428 
429 #endif // __ENCODING_HPP__
XString< char > AnsiString
Definition: utilities.hpp:257
XString< _ChTy > Sha384Hex(void const *buf, size_t size)
将数据进行sha384编码,返回16进制数字符串
Definition: encoding.hpp:362
Buffer Sha512(void const *buf, size_t size)
将数据进行sha512编码,返回二进制数据
XString< _ChTy > Base64Encode(void const *buf, size_t size)
Base64编码
Definition: encoding.hpp:186
AnsiString Base64Decode(XString< _ChTy > const &base64Str)
Base64解码,与Base64Encode()配套
XString< wchar > UnicodeString
Definition: utilities.hpp:258
void * getBuf() const
暴露缓冲区指针
Definition: utilities.hpp:993
char32_t char32
Definition: utilities.hpp:223
wchar_t wchar
Definition: utilities.hpp:229
Buffer Sha384(void const *buf, size_t size)
将数据进行sha384编码,返回二进制数据
XString< _ChTy > UriComponentEncodeBuffer(Buffer const &buf)
Definition: encoding.hpp:93
XString< tchar > String
Definition: utilities.hpp:261
Buffer Sha1(void const *buf, size_t size)
将数据进行sha1编码,返回二进制数据
Buffer Sha256(void const *buf, size_t size)
将数据进行sha256编码,返回二进制数据
size_t getSize() const
获取数据大小
Definition: utilities.hpp:1025
String UrlDecodeString(String const &encodedStr, bool isUtf8=sizeof(String::value_type)==sizeof(wchar))
URL解码,与UrlEncodeString()配套
String UriComponentEncodeString(String const &str, bool asUtf8=sizeof(String::value_type)==sizeof(wchar))
URI组成部分编码,遵循RFC1738.
AnsiString EncryptContent(AnsiString const &content)
内容加密
AnsiString DecryptContent(AnsiString const &encryptContent)
内容解密,与EncryptContent()配套
int RawDecrypt(byte const *encryptData, size_t dataSize, byte *buf, size_t bufSize, size_t *outSize)
未进行C++包装的内容解密,与RawEncrypt()配套
XString< _ChTy > BufferToHex(Buffer const &buf)
二进制数据转成16进制串
Definition: encoding.hpp:243
XString< _ChTy > Md5Hex(void const *buf, size_t size)
将数据进行md5编码,返回16进制数字符串
Definition: encoding.hpp:274
std::basic_string< _ChTy, std::char_traits< _ChTy >, std::allocator< _ChTy > > XString
Definition: utilities.hpp:255
缓冲区,表示内存中一块二进制数据(利用malloc/realloc进行内存分配)
Definition: utilities.hpp:906
int RawEncrypt(byte const *data, size_t dataSize, byte *buf, size_t bufSize, size_t *outSize)
未进行C++包装的内容加密
Buffer HexToBuffer(XString< _ChTy > const &hexStr)
16进制串转成二进制数据
String HtmlEncode(String const &str)
HTML编码。作用字符:&#39;&&#39;, &#39;<&#39;, &#39;>&#39;, &#39; &#39;.
XString< _ChTy > UriComponentEncode(void const *buf, size_t size)
URI组成部分编码,遵循RFC1738.
Definition: encoding.hpp:100
Buffer Base64DecodeBuffer(XString< _ChTy > const &base64Str)
Base64解码,与Base64Encode()配套
XString< _ChTy > UrlEncode(void const *buf, size_t size)
URL编码
Definition: encoding.hpp:36
Buffer Sha224(void const *buf, size_t size)
将数据进行sha224编码,返回二进制数据
#define WINUX_FUNC_DECL(ret)
Definition: utilities.hpp:64
XString< _ChTy > Sha224Hex(void const *buf, size_t size)
将数据进行sha224编码,返回16进制数字符串
Definition: encoding.hpp:318
unsigned char byte
Definition: utilities.hpp:249
XString< _ChTy > Base64EncodeBuffer(Buffer const &buf)
Base64编码
Definition: encoding.hpp:178
AnsiString UriComponentDecode(XString< _ChTy > const &encodedStr)
URI组成部分编码,与UriComponentEncode()配套
char16_t char16
Definition: utilities.hpp:222
Buffer Md5(void const *buf, size_t size)
将数据进行md5编码,返回二进制数据
XString< _ChTy > Sha512Hex(void const *buf, size_t size)
将数据进行sha512编码,返回16进制数字符串
Definition: encoding.hpp:384
AnsiString UrlDecode(XString< _ChTy > const &encodedStr)
URL编码,与UrlEncode()配套
Buffer UriComponentDecodeBuffer(XString< _ChTy > const &encodedStr)
URI组成部分编码,与UriComponentEncodeBuffer()配套
XString< _ChTy > UrlEncodeBuffer(Buffer const &buf)
Definition: encoding.hpp:29
XString< _ChTy > Sha1Hex(void const *buf, size_t size)
将数据进行sha1编码,返回16进制数字符串
Definition: encoding.hpp:296
EncryptErrorCode
内容加密错误代码
Definition: encoding.hpp:400
String UrlEncodeString(String const &str, bool asUtf8=sizeof(String::value_type)==sizeof(wchar))
URL编码
String HtmlDecode(String const &str)
HTML解码。与HtmlEncode()配套
String UriComponentDecodeString(String const &encodedStr, bool isUtf8=sizeof(String::value_type)==sizeof(wchar))
URI组成部分解码,与UriComponentEncodeString()配套
跨平台基础功能库
Definition: archives.hpp:7
Buffer UrlDecodeBuffer(XString< _ChTy > const &encodedStr)
URL编码,与UrlEncodeBuffer()配套
XString< _ChTy > Sha256Hex(void const *buf, size_t size)
将数据进行sha256编码,返回16进制数字符串
Definition: encoding.hpp:340