Files
michaelschiemer/tests/debug/verify-format-unmask.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

51 lines
1.2 KiB
PHP

<?php
echo "=== Format Information Unmasking Verification ===\n\n";
// What we have in the QR code
$maskedFormat = 0b101111001111100;
$maskedBinary = sprintf('%015b', $maskedFormat);
echo "Masked Format (in QR code): {$maskedBinary}\n";
// XOR mask that should be applied
$xorMask = 0b101010000010010;
$xorBinary = sprintf('%015b', $xorMask);
echo "XOR Mask (standard): {$xorBinary}\n";
// Unmask
$unmaskedFormat = $maskedFormat ^ $xorMask;
$unmaskedBinary = sprintf('%015b', $unmaskedFormat);
echo "Unmasked Format: {$unmaskedBinary}\n\n";
// Decode unmasked
$ecBits = substr($unmaskedBinary, 0, 2);
$maskBits = substr($unmaskedBinary, 2, 3);
$bchBits = substr($unmaskedBinary, 5);
echo "Decoded:\n";
echo " EC Level bits: {$ecBits} = ";
echo match($ecBits) {
'01' => 'L',
'00' => 'M',
'11' => 'Q',
'10' => 'H'
};
echo "\n";
echo " Mask Pattern bits: {$maskBits} = Pattern " . bindec($maskBits) . "\n";
echo " BCH Error Correction: {$bchBits}\n\n";
// Expected
echo "Expected (Level M, Mask 2):\n";
echo " EC Level: 00 (M)\n";
echo " Mask Pattern: 010 (2)\n\n";
if ($ecBits === '00' && $maskBits === '010') {
echo "✅ FORMAT INFORMATION IS CORRECT!\n";
} else {
echo "❌ FORMAT INFORMATION IS WRONG!\n";
}