captcha-plus
2.5.2 • Public • Published
Usages
const captcha = require("captcha-plus");
const fs = require("fs");
captcha.create("id");
//Create User Code [This has no time]
captcha.user("id");
/* Give
{
user: "id",
code: "user code"
}
*/
captcha.convert(captcha.user("id").code);
/* Give
{
buffer: <buffer...,
base64: 'data:image/png;base64....'
}
*/
const code = captcha.convert(captcha.user("id").code).buffer;
//Give You Buffer (Recommended)
fs.writeFileSync("captcha.png", code);
//Converts Buffer to Image (Saved Image)
captcha.convert(captcha.user("id").code).base64;
//Gives You Base64
captcha.check("id", code);
//If true, returns "true" else returns "false". [Type: boolean]
Changelog
+ Auto Create Database File
- image Deleted
+ base64 Added
Package Sidebar
Install
Weekly Downloads