All Projects → produck → Svg Captcha

produck / Svg Captcha

Licence: mit
generate svg captcha in node

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Svg Captcha

Pythonspidernotes
Python入门网络爬虫之精华版
Stars: ✭ 5,634 (+341.54%)
Mutual labels:  captcha
Multicaptchabot
The best bot for collecting cryptocurrency from freebitco.in, freedoge.co.in and freenem.com 🚀🌔
Stars: ✭ 27 (-97.88%)
Mutual labels:  captcha
Captcha break keras
keras theano 验证码破解 字母+数字
Stars: ✭ 60 (-95.3%)
Mutual labels:  captcha
Captcha Break
captcha break based on opencv2, tesseract-ocr and some machine learning algorithm.
Stars: ✭ 667 (-47.73%)
Mutual labels:  captcha
Hackcaptcha
provide api functions for captcha recognition.
Stars: ✭ 25 (-98.04%)
Mutual labels:  captcha
Crapcha
Completely Ridiculous And Phony Captcha that Hassles for Amusement
Stars: ✭ 42 (-96.71%)
Mutual labels:  captcha
Rucaptcha
Captcha gem for Rails Application. No dependencies. No ImageMagick, No RMagick.
Stars: ✭ 607 (-52.43%)
Mutual labels:  captcha
Captcha Breaker
High Accuracy Captcha Breaker with Tensorflow and Node.js
Stars: ✭ 76 (-94.04%)
Mutual labels:  captcha
Invisible captcha
🍯 Unobtrusive and flexible spam protection for Rails apps
Stars: ✭ 851 (-33.31%)
Mutual labels:  captcha
Easycaptcha
Java图形验证码,支持gif、中文、算术等类型,可用于Java Web、JavaSE等项目。
Stars: ✭ 1,084 (-15.05%)
Mutual labels:  captcha
Challenge Bypass Extension
Privacy Pass: a privacy-enhancing protocol and browser extension.
Stars: ✭ 679 (-46.79%)
Mutual labels:  captcha
Phpauth
PHPAuth is a secure PHP Authentication class that easily integrates into any site.
Stars: ✭ 748 (-41.38%)
Mutual labels:  captcha
Beelabrecaptcha2bundle
💻 Symfony bundle for Google Recaptcha2
Stars: ✭ 47 (-96.32%)
Mutual labels:  captcha
Captcha Tensorflow
Image Captcha Solving Using TensorFlow and CNN Model. Accuracy 90%+
Stars: ✭ 660 (-48.28%)
Mutual labels:  captcha
Django Simple Captcha
Django Simple Captcha is an extremely simple, yet highly customizable Django application to add captcha images to any Django form.
Stars: ✭ 1,151 (-9.8%)
Mutual labels:  captcha
Captchaimageview
Custom ImageView to generate captcha image.
Stars: ✭ 609 (-52.27%)
Mutual labels:  captcha
Ruhuman
simple captcha alternative
Stars: ✭ 29 (-97.73%)
Mutual labels:  captcha
Hooman
http interceptor to hoomanize cloudflare requests
Stars: ✭ 82 (-93.57%)
Mutual labels:  captcha
Happy Captcha
Happy Captcha是一款易于使用的Java验证码软件包,旨在花最短的时间,最少的代码量,实现Web站点的验证码功能。Happy Captcha完全遵循Apache 2.0开源许可协议,你可以自由使用该软件,如您在使用Happy Captcha时发现软件的任何缺陷,欢迎随时与我联系。
Stars: ✭ 75 (-94.12%)
Mutual labels:  captcha
Base64captcha
captcha of base64 and diversity
Stars: ✭ 1,050 (-17.71%)
Mutual labels:  captcha

svg-captcha

Build Status NPM Version NPM Downloads

generate svg captcha in node.js

Translations

中文

useful if you

  • cannot or do not want to use google recaptcha
  • have issue with install c++ addon

install

npm install --save svg-captcha

usage

var svgCaptcha = require('svg-captcha');

var captcha = svgCaptcha.create();
console.log(captcha);
// {data: '<svg.../svg>', text: 'abcd'}

with express

var svgCaptcha = require('svg-captcha');

app.get('/captcha', function (req, res) {
	var captcha = svgCaptcha.create();
	req.session.captcha = captcha.text;
	
	res.type('svg');
	res.status(200).send(captcha.data);
});

API

svgCaptcha.create(options)

If no option is passed, you will get a random string of four characters and corresponding svg.

  • size: 4 // size of random string
  • ignoreChars: '0o1i' // filter out some characters like 0o1i
  • noise: 1 // number of noise lines
  • color: true // characters will have distinct colors instead of grey, true if background option is set
  • background: '#cc9966' // background color of the svg image

This function returns an object that has the following property:

  • data: string // svg path data
  • text: string // captcha text

svgCaptcha.createMathExpr(options)

Similar to create api, you have the above options plus 3 additional:

  • mathMin: 1 // the minimum value the math expression can be
  • mathMax: 9 // the maximum value the math expression can be
  • mathOperator: + // The operator to use, +, - or +- (for random + or -)

This function returns an object that has the following property:

  • data: string // svg of the math expression
  • text: string // the answer of the math expression

svgCaptcha.loadFont(url)

Load your own font and override the default font.

  • url: string // path to your font This api is a wrapper around loadFont api of opentype.js.
    Your may need experiment around various options to make your own font accessible.
    See the following api.

svgCaptcha.options

Gain access to global setting object. It is used for create and createMathExpr api as the default options.

In addition to size, noise, color, and background, you can also set the following property:

  • width: number // width of captcha
  • height: number // height of captcha
  • fontSize: number // captcha text size
  • charPreset: string // random character preset

svgCaptcha.randomText([size|options])

return a random string.

svgCaptcha(text, options)

return a svg captcha based on text provided.

In pre 1.1.0 version you have to call these two functions,
now you can call create() to save some key strokes ;).

sample image

default captcha image:

image

math expression image with color options:

image2

why use svg?

It does not require any c++ addon.
The result image is smaller than jpeg image.

This has to be a joke. /<text.+>;.+</text>/g.test...

svg captcha uses opentype.js underneath, which means that there is no '<text>1234</text>'.
You get '<path fill="#444" d="M104.83 19.74L107.85 19.74L112 33.56L116.13 19.74L119.15 19.74L113.48 36.85...'
instead.

Even though you can write a program that convert svg to png, svg captcha has done its job
—— make captcha recognition harder

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].