Files
michaelschiemer/tests/debug/check-mask-pattern.php
Michael Schiemer fc3d7e6357 feat(Production): Complete production deployment infrastructure
- 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.
2025-10-25 19:18:37 +02:00

60 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;
echo "=== Mask Pattern Investigation ===\n\n";
// Generate QR code
$config = new QrCodeConfig(
version: QrCodeVersion::fromNumber(1),
errorCorrectionLevel: ErrorCorrectionLevel::M,
encodingMode: EncodingMode::BYTE
);
$matrix = QrCodeGenerator::generate("HELLO WORLD", $config);
// Read format info
$formatCols = [0, 1, 2, 3, 4, 5, 7, 8, 20, 19, 18, 17, 16, 15, 14];
$formatH = '';
foreach ($formatCols as $col) {
$formatH .= $matrix->getModuleAt(8, $col)->isDark() ? '1' : '0';
}
echo "Our Format Info: $formatH\n";
// Decode
$xorMask = "101010000010010";
$unmasked = '';
for ($i = 0; $i < 15; $i++) {
$unmasked .= (int)$formatH[$i] ^ (int)$xorMask[$i];
}
$ecBits = substr($unmasked, 0, 2);
$maskBits = substr($unmasked, 2, 3);
echo "Unmasked: $unmasked\n";
echo "EC Bits: $ecBits\n";
echo "Mask Bits: $maskBits\n";
echo "Our Mask Pattern: " . bindec($maskBits) . "\n\n";
// Python uses mask 0
echo "Python Format Info: 101010000010010 (M, Mask 0)\n";
echo "Python Mask Pattern: 0\n\n";
echo "=== PROBLEM FOUND ===\n";
echo "We're using Mask Pattern " . bindec($maskBits) . ", Python uses Mask Pattern 0!\n";
echo "Different masks = completely different QR codes!\n\n";
echo "Solution: Either\n";
echo "1. Use Mask Pattern 0 specifically\n";
echo "2. Ensure our mask pattern is applied correctly\n";