!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/multirest.picotech.app/public_html/vendor/bacon/bacon-qr-code/src/Common/   drwxr-xr-x
Free 28.21 GB of 117.98 GB (23.91%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     FormatInformation.php (5.66 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * BaconQrCode
 *
 * @link      http://github.com/Bacon/BaconQrCode For the canonical source repository
 * @copyright 2013 Ben 'DASPRiD' Scholzen
 * @license   http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
 */

namespace BaconQrCode\Common;

/**
 * Encapsulates a QR Code's format information, including the data mask used and error correction level.
 */
class FormatInformation
{
    
/**
     * Mask for format information.
     */
    
private const FORMAT_INFO_MASK_QR 0x5412;

    
/**
     * Lookup table for decoding format information.
     *
     * See ISO 18004:2006, Annex C, Table C.1
     */
    
private const FORMAT_INFO_DECODE_LOOKUP = [
        [
0x54120x00],
        [
0x51250x01],
        [
0x5e7c0x02],
        [
0x5b4b0x03],
        [
0x45f90x04],
        [
0x40ce0x05],
        [
0x4f970x06],
        [
0x4aa00x07],
        [
0x77c40x08],
        [
0x72f30x09],
        [
0x7daa0x0a],
        [
0x789d0x0b],
        [
0x662f0x0c],
        [
0x63180x0d],
        [
0x6c410x0e],
        [
0x69760x0f],
        [
0x16890x10],
        [
0x13be0x11],
        [
0x1ce70x12],
        [
0x19d00x13],
        [
0x07620x14],
        [
0x02550x15],
        [
0x0d0c0x16],
        [
0x083b0x17],
        [
0x355f0x18],
        [
0x30680x19],
        [
0x3f310x1a],
        [
0x3a060x1b],
        [
0x24b40x1c],
        [
0x21830x1d],
        [
0x2eda0x1e],
        [
0x2bed0x1f],
    ];

    
/**
     * Offset i holds the number of 1 bits in the binary representation of i.
     *
     * @var array
     */
    
private const BITS_SET_IN_HALF_BYTE = [0112122312232334];

    
/**
     * Error correction level.
     *
     * @var ErrorCorrectionLevel
     */
    
private $ecLevel;

    
/**
     * Data mask.
     *
     * @var int
     */
    
private $dataMask;

    protected function 
__construct(int $formatInfo)
    {
        
$this->ecLevel ErrorCorrectionLevel::forBits(($formatInfo >> 3) & 0x3);
        
$this->dataMask $formatInfo 0x7;
    }

    
/**
     * Checks how many bits are different between two integers.
     */
    
public static function numBitsDiffering(int $aint $b) : int
    
{
        
$a ^= $b;

        return (
            
self::BITS_SET_IN_HALF_BYTE[$a 0xf]
            + 
self::BITS_SET_IN_HALF_BYTE[(BitUtils::unsignedRightShift($a4) & 0xf)]
            + 
self::BITS_SET_IN_HALF_BYTE[(BitUtils::unsignedRightShift($a8) & 0xf)]
            + 
self::BITS_SET_IN_HALF_BYTE[(BitUtils::unsignedRightShift($a12) & 0xf)]
            + 
self::BITS_SET_IN_HALF_BYTE[(BitUtils::unsignedRightShift($a16) & 0xf)]
            + 
self::BITS_SET_IN_HALF_BYTE[(BitUtils::unsignedRightShift($a20) & 0xf)]
            + 
self::BITS_SET_IN_HALF_BYTE[(BitUtils::unsignedRightShift($a24) & 0xf)]
            + 
self::BITS_SET_IN_HALF_BYTE[(BitUtils::unsignedRightShift($a28) & 0xf)]
        );
    }

    
/**
     * Decodes format information.
     */
    
public static function decodeFormatInformation(int $maskedFormatInfo1int $maskedFormatInfo2) : ?self
    
{
        
$formatInfo self::doDecodeFormatInformation($maskedFormatInfo1$maskedFormatInfo2);

        if (
null !== $formatInfo) {
            return 
$formatInfo;
        }

        
// Should return null, but, some QR codes apparently do not mask this info. Try again by actually masking the
        // pattern first.
        
return self::doDecodeFormatInformation(
            
$maskedFormatInfo1 self::FORMAT_INFO_MASK_QR,
            
$maskedFormatInfo2 self::FORMAT_INFO_MASK_QR
        
);
    }

    
/**
     * Internal method for decoding format information.
     */
    
private static function doDecodeFormatInformation(int $maskedFormatInfo1int $maskedFormatInfo2) : ?self
    
{
        
$bestDifference PHP_INT_MAX;
        
$bestFormatInfo 0;

        foreach (
self::FORMAT_INFO_DECODE_LOOKUP as $decodeInfo) {
            
$targetInfo $decodeInfo[0];

            if (
$targetInfo === $maskedFormatInfo1 || $targetInfo === $maskedFormatInfo2) {
                
// Found an exact match
                
return new self($decodeInfo[1]);
            }

            
$bitsDifference self::numBitsDiffering($maskedFormatInfo1$targetInfo);

            if (
$bitsDifference $bestDifference) {
                
$bestFormatInfo $decodeInfo[1];
                
$bestDifference $bitsDifference;
            }

            if (
$maskedFormatInfo1 !== $maskedFormatInfo2) {
                
// Also try the other option
                
$bitsDifference self::numBitsDiffering($maskedFormatInfo2$targetInfo);

                if (
$bitsDifference $bestDifference) {
                    
$bestFormatInfo $decodeInfo[1];
                    
$bestDifference $bitsDifference;
                }
            }
        }

        
// Hamming distance of the 32 masked codes is 7, by construction, so <= 3 bits differing means we found a match.
        
if ($bestDifference <= 3) {
            return new 
self($bestFormatInfo);
        }

        return 
null;
    }

    
/**
     * Returns the error correction level.
     */
    
public function getErrorCorrectionLevel() : ErrorCorrectionLevel
    
{
        return 
$this->ecLevel;
    }

    
/**
     * Returns the data mask.
     */
    
public function getDataMask() : int
    
{
        return 
$this->dataMask;
    }

    
/**
     * Hashes the code of the EC level.
     */
    
public function hashCode() : int
    
{
        return (
$this->ecLevel->getBits() << 3) | $this->dataMask;
    }

    
/**
     * Verifies if this instance equals another one.
     */
    
public function equals(self $other) : bool
    
{
        return (
            
$this->ecLevel === $other->ecLevel
            
&& $this->dataMask === $other->dataMask
        
);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0037 ]--