Svg-captcha

svg-captcha

Generate svg captcha.

svg-captcha uses OpenType font parser and text skewing martix logic to generate random SVG captchas.

It returns an object which has the SVG data and the text which was used to generate the same.

Get it: npm install --save captcha

Sample usage:

1
2
3
4
5
6
7
8
9
10
11
12
13
var svgCaptcha = require('svg-captcha');

// generate random text of length 4
var text = svgCaptcha.randomText();

// generate svg image
var captcha = svgCaptcha(text);

// generate both and returns an object
var captcha = svgCaptcha.create();

console.log(c);
// {data: '<svg.../svg>', text: 'abcd'}

GIF FTW:

svg-captcha

Suggest a module

Comments