New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

node-math-captcha

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-math-captcha

A math captcha for node

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

node-math-captcha

A math captcha for node

Install

  • GraphicsMagicks (OS package) is needed
  • npm install node-math-captcha

Usage

require('node-math-captcha').generate(bgFile, fontFile, outputDir, numOps, callback)

  • bgFile - a relative path (from your app's point) with filename for desired background image
  • fontFile - a relative path (from your app's entry point) with filename for desired font
  • outputDir - a relative path (from your app's entry point)
  • numOps - number of operations in the captcha challenge
  • callback - is called as callback(err, imageName, answerStr)

An easy method is to use express sessions to store the captcha answer. Have your frontend signup page request a captcha via a route that calls the generate function. Then your backend signup script can compare user input to the captcha answer stored in the express session. Of course, on failed attempts (and successes) you want to invalidate the captcha (e.g. set answer to equal null).

Sample Screenshot

Screenshot

Keywords

captcha

FAQs

Package last updated on 01 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts