Update zerostoragecaptcha.cpp

pull/2/head
acetone 2022-04-24 06:52:12 -04:00 committed by GitHub
parent 22416fd246
commit 69cce22e22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -28,6 +28,8 @@
#include <QPainter>
#include <random>
bool ZeroStorageCaptcha::m_onlyNumbers = false;
ZeroStorageCaptcha::ZeroStorageCaptcha()
{
if (not ZeroStorageCaptchaCrypto::TimeToken::inited()) ZeroStorageCaptchaCrypto::TimeToken::init();
@ -183,7 +185,7 @@ void ZeroStorageCaptcha::setDifficulty(int val)
{
if (val < 0 or val > 5)
{
qInfo() << QString(__PRETTY_FUNCTION__) << "Min difficulty is 0, maximal is 5";
qInfo().noquote() << QString(__PRETTY_FUNCTION__) << "Min difficulty is 0, maximal is 5";
}
if (val < 1)
@ -266,7 +268,7 @@ void ZeroStorageCaptcha::generateText(int length)
length = 5;
}
m_captchaText = ZeroStorageCaptchaCrypto::random(length);
m_captchaText = ZeroStorageCaptchaCrypto::random(length, m_onlyNumbers);
updateCaptcha();
}
}