🚀 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 - npm Package Compare versions

Comparing version

to
1.2.1

2

package.json
{
"name": "captcha-generator-react",
"version": "1.2.0",
"version": "1.2.1",
"main": "index.mjs",

@@ -5,0 +5,0 @@ "types": "index.d.ts",

@@ -1,2 +0,2 @@

# generate-captcha
# Generate captcha

@@ -17,1 +17,21 @@ 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.

```
# Usage
```bash
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:
js
Copy
Edit
const { captchaText, captchaImage } = generateCaptcha(5, 150, 50);
```