🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

captcha-generator-react

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

captcha-generator-react

A lightweight utility to generate image-based captchas using the HTML5 Canvas API. Returns a base64 image and the corresponding captcha text for easy verification.

1.6.3
npm
Version published
Weekly downloads
8
-80%
Maintainers
1
Weekly downloads
 
Created
Source

Generate captcha

A lightweight utility to generate image-based captchas using the HTML5 Canvas API. Returns a base64 image and the corresponding captcha text for easy verification.

✨ Features

  • Generates random captchas using alphanumeric characters
  • Returns both captcha text and base64 image
  • Customizable width, height, and character length
  • Adds random interference lines for better security

📦 Installation

Using npm

npm install captcha-generator-react

Using pnpm

pnpm add captcha-generator-react

Usage

import generateCaptcha from "generate-captcha";

const { captchaText, captchaImage } = generateCaptcha();

console.log(captchaText); // Example: "aZ4pQ2"
console.log(captchaImage); // Base64-encoded PNG image

// You can also customize the captcha length, width, and height:
const { captchaText, captchaImage } = generateCaptcha(5, 150, 50);

Keywords

captcha

FAQs

Package last updated on 02 May 2025

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