资源简介
整理的三个nodejs项目

代码片段和文件信息
/**
* Copyright (c) 2006-2008 Apple Inc. All rights reserved.
*
* Licensed under the Apache License Version 2.0 (the “License“);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
#include “base64.h“
#include
#include
// base64 tables
static char basis_64[] =
“ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/“;
static signed char index_64[128] =
{
-1-1-1-1 -1-1-1-1 -1-1-1-1 -1-1-1-1
-1-1-1-1 -1-1-1-1 -1-1-1-1 -1-1-1-1
-1-1-1-1 -1-1-1-1 -1-1-162 -1-1-163
52535455 56575859 6061-1-1 -1-1-1-1
-1 0 1 2 3 4 5 6 7 8 910 11121314
15161718 19202122 232425-1 -1-1-1-1
-1262728 29303132 33343536 37383940
41424344 45464748 495051-1 -1-1-1-1
};
#define CHAR64(c) (((c) < 0 || (c) > 127) ? -1 : index_64[(c)])
// base64_encode : base64 encode
//
// value : data to encode
// vlen : length of data
// (result) : new char[] - c-str of result
char *base64_encode(const unsigned char *value int vlen)
{
char *result = (char *)malloc((vlen * 4) / 3 + 5);
char *out = result;
while (vlen >= 3)
{
*out++ = basis_64[value[0] >> 2];
*out++ = basis_64[((value[0] << 4) & 0x30) | (value[1] >> 4)];
*out++ = basis_64[((value[1] << 2) & 0x3C) | (value[2] >> 6)];
*out++ = basis_64[value[2] & 0x3F];
value += 3;
vlen -= 3;
}
if (vlen > 0)
{
*out++ = basis_64[value[0] >> 2];
unsigned char oval = (value[0] << 4) & 0x30;
if (vlen > 1) oval |= value[1] >> 4;
*out++ = basis_64[oval];
*out++ = (vlen < 2) ? ‘=‘ : basis_64[(value[1] << 2) & 0x3C];
*out++ = ‘=‘;
}
*out = ‘\0‘;
return result;
}
// base64_decode : base64 decode
//
// value : c-str to decode
// rlen : length of decoded result
// (result) : new unsigned char[] - decoded result
unsigned char *base64_decode(const char *value int *rlen)
{
*rlen = 0;
int c1 c2 c3 c4;
int vlen = strlen(value);
unsigned char *result =(unsigned char *)malloc((vlen * 3) / 4 + 1);
unsigned char *out = result;
while (1)
{
if (value[0]==0)
return result;
c1 = value[0];
if (CHAR64(c1) == -1)
goto base64_decode_error;;
c2 = value[1];
if (CHAR64(c2) == -1)
goto base64_decode_error;;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3065 2013-06-26 13:54 chatrooms\chatrooms\lib\chat_server.js
文件 1075 2013-06-26 10:22 chatrooms\chatrooms\node_modules\mime\LICENSE
文件 2790 2013-06-26 10:22 chatrooms\chatrooms\node_modules\mime\mime.js
文件 2839 2013-06-26 10:22 chatrooms\chatrooms\node_modules\mime\package.json
文件 2017 2013-06-26 10:22 chatrooms\chatrooms\node_modules\mime\README.md
文件 1443 2013-06-26 10:22 chatrooms\chatrooms\node_modules\mime\test.js
文件 53011 2013-06-26 10:22 chatrooms\chatrooms\node_modules\mime\types\mime.types
文件 1946 2013-06-26 10:22 chatrooms\chatrooms\node_modules\mime\types\node.types
文件 22 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\.npmignore
文件 87 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\.travis.yml
文件 1791 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\benchmarks\decode.bench.js
文件 2117 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\benchmarks\encode.bench.js
文件 1255 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\benchmarks\runner.js
文件 10816 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\History.md
文件 142 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\index.js
文件 1420 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\logger.js
文件 22165 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\manager.js
文件 7080 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\namespace.js
文件 4733 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\parser.js
文件 2443 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\socket.io.js
文件 6508 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\socket.js
文件 10034 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\static.js
文件 1505 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\store.js
文件 1918 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\stores\memory.js
文件 5531 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\stores\redis.js
文件 10794 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\transport.js
文件 2958 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\transports\flashsocket.js
文件 1437 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\transports\htmlfile.js
文件 2450 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\transports\http-polling.js
文件 2407 2013-06-26 10:29 chatrooms\chatrooms\node_modules\socket.io\lib\transports\http.js
............此处省略3275个文件信息
相关资源
- 人脸识别开发包免费,可商用,有演
- 2019年软考高级下半年信息系统项目管
- 十次方项目
- 《THE ONE-PAGE PROJECT MANAGER FOR EXECUTION(
- oracle数据迁移项目实施方案
- 60个HFSS 仿真模型库
- CCS中如何生成LIB文件-并在另外CCS项目
- DELPHI与西门子200PLC的串口通信实例
- mybatis连接oracle实例
- LabVIEW钢琴实例
- 通信软件的具体实例──基于Socket的
- 农场开发项目
- vrml学习实例
- 汇编语言实例
- 51单片机基于protues的几个仿真实例
- S7-200模拟量编程实例
- SIP电话实例
- 4 1视图建模教程实例大全
- FPGA在步进电机驱动上的应用实例及代
- 完整的项目案例
- GIS项目开发文档(分析、设计、实现
- ARM嵌入式项目实战
- 基于Apache Mina实现的TCP长连接和短连接
- js万能播放器,网页播放插件实例
- MFC网络编程实例
- Zebra打印实例Delphi
- 软件工程(数据流图) 实例
- 项目周报格式(excel格式报表)
- PSCAD风电建模实例双馈风力发电机的
- virtuoso实例教学
评论
共有 条评论