📄 base64.h
字号:
/*******************************************
* Base64编码、解码
* 编码中可以指明每个若干个字符插入一个换行符
* 解码时可以忽略其中的回车、换行符
* Author: lubing
* Date: Oct. 26, 2000
*******************************************/
#ifndef _BASE64_H
#define _BASE64_H
#ifdef __cplusplus
extern "C" {
#endif
/***********************************
* Encode a string.
* IN:
* src: the string to be encoded.
* srclen: the length the content in src, so the function can process binany data.
* dest: the buffer to store the result.
* destlen: the size of the buffer.
* wraplen: the characters number inteval a newline(\n) will be inserted.
* 0 means no newline needed.
* OUT:
* 0: the buffer is too small to store the result.
* >0: the length of the result.
***********************************/
int Base64Encode(const char* src, const int srclen, char* dest, const int destlen, const int wraplen);
/***********************************
* Decode a base64 string..
* IN:
* src: the string to be decoded. LF/CR will be discarded.
* dest: the buffer to store the result.
* destlen: the size of the buffer.
* OUT:
* 0: the buffer is too small to store the result.
* >0: the length of the result.
***********************************/
int Base64Decode(const char* src, char* dest, const int destlen);
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -