captcha-generator-react
Advanced tools
Comparing version
{ | ||
"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); | ||
``` |
2284
19.96%37
117.65%