诸暨麻将添加redis
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

71 lines
1.4 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 <windows.h>
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /*
  27. 功能:将二进制数据转换成BASE64编码字符串
  28. 参数说明:
  29. inputBuffer:要编码的二进制数据
  30. inputCount:数据长度
  31. outputBuffer:存储转换后的BASE64编码字符串
  32. 返回值:
  33. -1:参数错误
  34. >=0:有效编码长度(字符数),不包括字符串结束符。
  35. 备注:
  36. 等效于openssl中EVP_EncodeBlock函数
  37. */
  38. INT BASE64_Encode(const BYTE* inputBuffer, INT inputCount, TCHAR* outputBuffer);
  39. /*
  40. 功能:将BASE64编码字符串转换为二进制数据
  41. 参数说明:
  42. inputBuffer:BASE64编码字符串
  43. inputCount:编码长度(字符数),应该为4的倍数。
  44. outputBuffer:存储转换后的二进制数据
  45. 返回值:
  46. -1:参数错误
  47. -2:数据错误
  48. >=0:转换后的字节数
  49. 备注:
  50. 等效于openssl中EVP_DecodeBlock函数
  51. */
  52. INT BASE64_Decode(const TCHAR* inputBuffer, INT inputCount, BYTE* outputBuffer);
  53. #ifdef __cplusplus
  54. }
  55. #endif