资源简介
书中源代码,nodejs-mongodb-angularjs-web-development-master
代码片段和文件信息
/**
* 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;;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\
文件 143 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\README.md
目录 0 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch03\
目录 0 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch03\censorify\
文件 0 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch03\censorify\README.md
文件 571 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch03\censorify\censortext.js
文件 204 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch03\censorify\package.json
文件 369 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch03\censorify\publish_package.json
目录 0 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch03\readwords\
目录 0 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch03\readwords\node_modules\
目录 0 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch03\readwords\node_modules\censorify\
文件 0 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch03\readwords\node_modules\censorify\README.md
文件 571 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch03\readwords\node_modules\censorify\censortext.js
文件 472 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch03\readwords\node_modules\censorify\package.json
文件 369 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch03\readwords\node_modules\censorify\publish_package.json
文件 262 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch03\readwords\readwords.js
目录 0 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch04\
文件 353 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch04\callback_chain.js
文件 469 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch04\callback_closure.js
文件 694 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch04\callback_parameter.js
文件 933 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch04\emmiter_listener.js
文件 415 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch04\nexttick.js
文件 288 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch04\simple_interval.js
文件 374 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch04\simple_timer.js
目录 0 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch05\
文件 248 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch05\buffer_concat.js
文件 730 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch05\buffer_copy.js
文件 376 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch05\buffer_read.js
文件 272 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch05\buffer_slice.js
文件 218 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch05\buffer_write.js
文件 1201 2014-11-10 22:12 nodejs-mongodb-angularjs-web-development-master\ch05\buffered_data.js
............此处省略2566个文件信息
相关资源
- go语言实现udp server和MongoDB数据写入
- Angulr– Bootstrap Admin Web App with Angular
- 整理的三个nodejs项目
- Node.js参考手册-新版.CHM
- 图灵程序设计丛书-Node.js 设计模式
- webapi + mongodb 基础 代码简单易懂 直接
- NodeJs+Angular+Mongodb Web开发2
- Node.js实战 第2版 图灵
- Spring boot -- 基于AngularJS的网络商城系
- Maven之Spring Boot_AngularJS--网络商城系统
- mongoDb源码和笔记
- maven-springboot-bootstrap-angularjs学生数据
- node_express_mongodb_vue.rar
- Node.js从入门到精通_中文高清.pdf
- node.js+socket.io+websocket使用demo
- node.js项目实践:构建可扩展的web应用
- 《深入浅出Node.js》(高清版)
- Node.js实战第2版[pdf]
- MongoDB权威指南完整版带书签目录
- Node.js实战第2版PDF版
- AngularJS+SpringMVC小项目
- Node.js开发指南中文正版
- angularJs 1.3.0最新
- vue2.0+node.js+MongoDB全栈打造商城-源码
- AngularJs+Bootstrap前端框架
- Robomongo-0.8.4-i386.exe
- Node学生管理系统Express+MongoDB
- Node.js实战 第2版 非扫描 pdf
- Manning.MongoDB.in.Action.2nd.Edition.2016.3
- node.js实战第二版
评论
共有 条评论