I want to generate a random UpperCase / LowerCase captcha how do I do that
PiinnKs opened this issue · 1 comments
PiinnKs commented
const captchacode = crypto.randomBytes(32).toString("hex").substr(0, 4);
const captcha = new CaptchaGenerator()
.setCaptcha({text: captchacode, size: 60, color: '#e600ff'})
.setTrace({color: '#e600ff', size: 6});
const buffer = await captcha.generate();
Shashank3736 commented
You can generate captcha text by using crypto.
Docs: https://nodejs.org/dist/latest-v14.x/docs/api/crypto.html#crypto_crypto_randombytes_size_callback