28 Star 119 Fork 47

linuxmail/lib-zc

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
uu.cpp 889 Bytes
一键复制 编辑 原始数据 按行查看 历史
linuxmail 提交于 2026-03-04 20:11 +08:00 . 语法检查
/*
* ================================
* eli960@qq.com
* http://linuxmail.cn/
* 2021-04-23
* ================================
*/
#include "zcc/zcc_stdlib.h"
zcc_namespace_begin;
void uudecode(const void *src, int src_size, std::string &str)
{
const unsigned char *s = (const unsigned char *)src;
if (src_size < 0)
{
src_size = (int)std::strlen((const char *)s);
}
const unsigned char *e = s + src_size;
while (s < e - 4)
{
int v = 0;
int i;
for (i = 0; i < 4; i += 1)
{
int c = *s++;
v = v << 6 | ((c - 0x20) & 0x3F);
}
for (i = 2; i >= 0; i -= 1)
{
int c = (v & 0xFF);
str.push_back((char)c);
v = v >> 8;
}
}
while (s < e)
{
int c = *s++;
str.push_back((char)c);
}
}
zcc_namespace_end;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/linuxmail/lib-zc.git
git@gitee.com:linuxmail/lib-zc.git
linuxmail
lib-zc
lib-zc
master

搜索帮助