Captchar

Generate captcha image. Written in Node.js.
Installation
Node-captchar requires canvas, pleace follow canvas's installation wiki to install dependencies.
Features
- Background noises
- Support dummy character (presented in red color)
- Customizable string pool
Usage
var captchar = require('captchar')
captchar()
.then(function (data) {
console.log(data)
})
captchar({ format: 'datauri' })
.then(function (data) {
console.log(data)
})
captchar({ format: 'stream' })
.then(function (data) {
console.log(data)
})
Options
captchar({
width: 80,
height: 30,
fontSize: 22,
fontFamily: 'Times New Roman',
textLength: 4,
backgroundColor: '#fff',
outputDir: process.cwd()) + '/.captchar/',
imageName: md5(Date.now().toString())) + '.png',
format: 'fs',
pool: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
dummy: true
})
Example with default options:

The real code is 5HPp
, o
is dummy.
Contributors