诸暨麻将添加redis
您不能選擇超過 %s 個話題 話題必須以字母或數字為開頭,可包含連接號 ('-') 且最長為 35 個字
 
 
 
 
 
 

76 行
1.5 KiB

  1. /* ----------------------------------------------------------
  2. 文件名称:BASE64_API.h
  3. 作者:秦建辉
  4. MSN:splashcn@msn.com
  5. 当前版本:V1.1
  6. 历史版本:
  7. V1.1 2010年05月11日
  8. 修正BASE64解码的Bug。
  9. V1.0 2010年05月07日
  10. 完成正式版本。
  11. 功能描述:
  12. BASE64编码和解码
  13. 接口函数:
  14. Base64_Encode
  15. Base64_Decode
  16. 说明:
  17. 1. 参考openssl-1.0.0。
  18. 2. 改进接口,以使其适应TCHAR字符串。
  19. 3. 修正EVP_DecodeBlock函数解码时未去掉填充字节的缺陷。
  20. ------------------------------------------------------------ */
  21. #pragma once
  22. #include <string>
  23. #include <windows.h>
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /*
  28. 功能:将二进制数据转换成BASE64编码字符串
  29. 参数说明:
  30. inputBuffer:要编码的二进制数据
  31. inputCount:数据长度
  32. outputBuffer:存储转换后的BASE64编码字符串
  33. 返回值:
  34. -1:参数错误
  35. >=0:有效编码长度(字符数),不包括字符串结束符。
  36. 备注:
  37. 等效于openssl中EVP_EncodeBlock函数
  38. */
  39. INT BASE64_Encode(const BYTE* inputBuffer, INT inputCount, TCHAR* outputBuffer);
  40. /*
  41. 功能:将BASE64编码字符串转换为二进制数据
  42. 参数说明:
  43. inputBuffer:BASE64编码字符串
  44. inputCount:编码长度(字符数),应该为4的倍数。
  45. outputBuffer:存储转换后的二进制数据
  46. 返回值:
  47. -1:参数错误
  48. -2:数据错误
  49. >=0:转换后的字节数
  50. 备注:
  51. 等效于openssl中EVP_DecodeBlock函数
  52. */
  53. INT BASE64_Decode(const TCHAR* inputBuffer, INT inputCount, BYTE* outputBuffer);
  54. std::string base64_decode(std::string const& s);
  55. std::string b64decodestring(const std::string& strString);
  56. #ifdef __cplusplus
  57. }
  58. #endif