- Add comprehensive health check system with multiple endpoints - Add Prometheus metrics endpoint - Add production logging configurations (5 strategies) - Add complete deployment documentation suite: * QUICKSTART.md - 30-minute deployment guide * DEPLOYMENT_CHECKLIST.md - Printable verification checklist * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference * production-logging.md - Logging configuration guide * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation * README.md - Navigation hub * DEPLOYMENT_SUMMARY.md - Executive summary - Add deployment scripts and automation - Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment - Update README with production-ready features All production infrastructure is now complete and ready for deployment.
58 lines
1.6 KiB
PHP
58 lines
1.6 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/../../vendor/autoload.php';
|
|
|
|
use App\Framework\QrCode\QrCodeGenerator;
|
|
use App\Framework\QrCode\ValueObjects\ErrorCorrectionLevel;
|
|
use App\Framework\QrCode\ValueObjects\QrCodeConfig;
|
|
use App\Framework\QrCode\ValueObjects\QrCodeVersion;
|
|
use App\Framework\QrCode\ValueObjects\EncodingMode;
|
|
use App\Framework\QrCode\Masking\MaskPattern;
|
|
|
|
echo "=== Comparing Unmasked Data ===\n\n";
|
|
|
|
// Generate our QR code
|
|
$config = new QrCodeConfig(
|
|
version: QrCodeVersion::fromNumber(1),
|
|
errorCorrectionLevel: ErrorCorrectionLevel::M,
|
|
encodingMode: EncodingMode::BYTE
|
|
);
|
|
|
|
$ourMatrix = QrCodeGenerator::generate("HELLO WORLD", $config);
|
|
$size = 21;
|
|
|
|
// Our mask is Pattern 2: column % 3 == 0
|
|
// Unmask a few data positions by applying mask again
|
|
$mask2 = MaskPattern::PATTERN_2;
|
|
|
|
echo "Unmasking our data (applying mask 2 again to reverse):\n";
|
|
echo "Testing positions in data area:\n\n";
|
|
|
|
$testPositions = [
|
|
[20, 20], // Bottom-right
|
|
[20, 19],
|
|
[19, 20],
|
|
[18, 20],
|
|
[17, 20],
|
|
];
|
|
|
|
foreach ($testPositions as [$row, $col]) {
|
|
$maskedValue = $ourMatrix->getModuleAt($row, $col)->isDark() ? 1 : 0;
|
|
$shouldInvert = $mask2->shouldInvert($row, $col);
|
|
$unmaskedValue = $shouldInvert ? (1 - $maskedValue) : $maskedValue;
|
|
|
|
echo sprintf(
|
|
" [%2d,%2d]: masked=%d, shouldInvert=%s, unmasked=%d\n",
|
|
$row, $col,
|
|
$maskedValue,
|
|
$shouldInvert ? 'Y' : 'N',
|
|
$unmaskedValue
|
|
);
|
|
}
|
|
|
|
echo "\nThis shows the actual data bits before masking.\n";
|
|
echo "If data placement is correct, these should match the encoded codewords.\n";
|
|
|