KoaHub.JS基于Node.js开发的Koa 生成验证码插件代

ccap

node.js generate captcha using c++ library CImg without install any other lib or software

node-ccap —— node.js generate captcha using c++ library CImg.

You can generate captcha without install any other libraries or software, only do npm install ccap, that‘s all.

node-ccap support linux and windows.

compile maybe cost you 1 minute,simply wait;

performance

generate captcha picture 697/sec;

Install

npm install ccap

var ccap = require(‘ccap‘)

Instantiated

these three ways all will be ok:

var captcha = ccap();

var captcha = ccap(width, height, offset);

var captcha = ccap({

	width:256,//set width,default is 256

	height:60,//set height,default is 60

	offset:40,//set text spacing,default is 40

	quality:100,//set pic quality,default is 50

	generate:function(){//Custom the function to generate captcha text

	     //generate captcha text here

	     return text;//return the captcha text

	}

});

  

API

var captcha = ccap();

var ary = captcha.get();//ary[0] is captcha‘s text,ary[1] is captcha picture buffer.

var text = ary[0];

var buffer = ary[1];

  

Simple Example

var http = require(‘http‘);

var ccap = require(‘../‘)();//Instantiated ccap class

http.createServer(function (request, response) {

	if(request.url == ‘/favicon.ico‘)return response.end(‘‘);//Intercept request favicon.ico

	var ary = ccap.get();

	var txt = ary[0];

	var buf = ary[1];

	response.end(buf);

	console.log(txt);

}).listen(8124);

console.log(‘Server running at http://127.0.0.1:8124/‘);

  

授权协议

基于MIT协议发布:

The MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

  

wemall 开源微商城 ,微信商城,商城源码,三级分销,微生鲜,微水果,微外卖,微订餐---专业的o2o系统 wemall地址:http://www.wemallshop.com

代码详情:http://js.koahub.com/home/feature/ccap

时间: 2024-10-14 16:39:38

KoaHub.JS基于Node.js开发的Koa 生成验证码插件代的相关文章

KoaHub平台基于Node.js开发的Koa的简单包装到请求库的类似接口

co-request co-request promisify wrapper for request co-request Simple wrapper to the request library for co-like interface (node.js generator based code). You can use it with koa or co To install simply run: npm install co-request Require co first, a

KoaHub.JS基于Node.js开发的处理和显示日期代码

moment Parse, validate, manipulate, and display dates      A lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates. Documentation Port to ECMAScript 6 (version 2.10.0) Moment 2.10.0 does not bring any new fea

KoaHub平台基于Node.js开发的Koa router路由插件代码信息详情

koa-router Router middleware for koa. Provides RESTful resource routing. koa-router       Router middleware for koa Express-style routing using app.get, app.put, app.post, etc. Named URL parameters. Named routes with URL generation. Responds to OPTIO

KoaHub平台基于Node.js开发的Koa的skip插件代码详情

koahub-skip koahub skip middleware koahub skip Conditionally skip a middleware when a condition is met. Install npm i koahub-skip --save Usage With existing middlewares: var skip = require('koahub-skip'); var serve = require('koa-static'); var static

KoaHub平台基于Node.js开发的Koa的rewrite and index support插件代码详情

koa-static-server Static file serving middleware for koa with directory, rewrite and index support koa-static-server static file serving middleware for koa with directory, rewrite and index support Installation $ npm install koa-static-server API var

node.js高级编程|node.js 视频教程_基于node.js+Express.js+Jade+MongoDB实战开发

基于node.js+Express.js+Jade+MongoDB开发Web即时聊天系统课程讲师:幻星课程分类:前端开发适合人群:初级课时数量:36课时更新程度:完成用到技术:Node.js NPM. Express.NoSQL,MongoDB涉及项目:匿名聊天网站系统node.js视频教程:http://www.ibeifeng.com/goods-462.htmlnode.js 教程适合人群:node.js视频教程要求学员了解JavaScript,node.js入门教程适合希望更深入的学习N

基于node.js 的 websocket的移动端H5直播开发

这一篇介绍一下基于node.js 的 websocket的移动端H5直播开发, 下载文章底部的源码,我是用vscode打开, 首先在第一个终端运行 npm run http-server 这个指令是运行http服务,手机端直接运行http://ip:8000/mpegts.html 即可看到推流过来的视频 新起一个终端运行 npm run ws-server,服务启动后,即可以通过ffmpeg进行推流. 推流过程如下: 推流视频文件: ffmpeg -re -i E:\2.mp4   -code

基于Node.js + jade + Mongoose 模仿gokk.tv

原文摘自我的前端博客,欢迎大家来访问 http://www.hacke2.cn 关于gokk 大学的娱乐活动基本就是在寝室看电影了→_→,一般都会选择去goxiazai.cc上看,里面的资源多,质量高 .站长会推荐评分很高广受好评的电影给大家免费下载,整体来说真是不错,但前两月由于版权问题被迫转型 这也是没办法的事,程序员更应该尊重版权问题,我们也能理解,后来站长又开了gokk个不是给地址让你 下载,而是将网络一些优秀视频站点资源提供出来观看,质量变低了,好怀念以前的goxiazai啊.. 最近

基于Node.js和express的日志服务器

首先,这篇文章学习的意义大于实际价值.如果按我的本意,直接在游戏中加入友盟,信息更全,而且非常简单.不过总是有很多人会凭着自己过时或者错误的经验去说别的东西多么不好,自己的东西多么好.好在,我自认为学习能力非常强,解决问题的能力也非常强.真让我做一个服务器+前端,也是在兴趣之中和能力之内. 一.Node.js简介 原本javascript纯粹是一个前端语言,干的基本上是让网页更丰富更炫的事情.不过Node.js出现后,javacript成为了前后端通吃的语言.比如网易的pomelo就是基于Nod