added QROptions

This commit is contained in:
smiley
2015-12-08 22:54:30 +01:00
parent e21a7da686
commit 02d140d582
3 changed files with 78 additions and 82 deletions
+7 -8
View File
@@ -4,20 +4,19 @@ require_once '../vendor/autoload.php';
use chillerlan\QRCode\QRCode;
use chillerlan\QRCode\QRConst;
use chillerlan\QRCode\QROptions;
$starttime = microtime(true);
$qrcode = (new QRCode)
->setErrorCorrectLevel(QRConst::ERROR_CORRECT_LEVEL_M)
->setQRType(QRConst::TYPE_05)
;
$qrOptions = new QROptions;
$qrOptions->typeNumber = QRConst::TYPE_05;
$qrOptions->errorCorrectLevel = QRConst::ERROR_CORRECT_LEVEL_M;
// google authenticator
// https://chart.googleapis.com/chart?chs=200x200&chld=M%7C0&cht=qr&chl=otpauth%3A%2F%2Ftotp%2Ftest%3Fsecret%3DB3JX4VCVJDVNXNZ5%26issuer%3Dchillerlan.net
$qrcode
->setData('otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5&issuer=chillerlan.net')
->getRawData()
;
$qrcode = new QRCode;
$qrcode->setOptions($qrOptions, 'otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5&issuer=chillerlan.net');
$qrcode->getRawData();
for($row = 0; $row < $qrcode->pixelCount; $row++){
for($col = 0; $col < $qrcode->pixelCount; $col++){