src/builders/DecimalBuilder.php
public function readBit($byteString, $bitPosition) {
        $byteNumber = $this->findByteNumberForBitPosition($bitPosition);
        $bitPositionInByte = $bitPosition % 8;
        $pos = strlen($byteString) - 1 - $byteNumber;
        $targetByte = $byteString[$pos];
        $mask = chr(1 << $bitPositionInByte);
        $filteredByte = $mask & $targetByte;
        $bitValue = 0;
        if (ord($filteredByte) > 0) {
            $bitValue = 1;
        }
        return $bitValue;
    }
public function readBit($byteString, $bitPosition) {
        $byteNumber = $this->findByteNumberForBitPosition($bitPosition);
        $bitPositionInByte = $bitPosition % 8;
        $pos = strlen($byteString) - 1 - $byteNumber;
        $targetByte = $byteString[$pos];
        $mask = chr(1 << $bitPositionInByte);
        $filteredByte = $mask & $targetByte;
        $bitValue = 0;
        if (ord($filteredByte) > 0) {
            $bitValue = 1;
        }
        return $bitValue;
    }
public function readBit ( $ byteString , $ bitPosition ) { $ byteNumber = $ this -> findByteNumberForBitPosition ( $ bitPosition ) ; $ bitPositionInByte = $ bitPosition % 8 ; $ pos = strlen ( $ byteString ) - 1 - $ byteNumber ; $ targetByte = $ byteString [ $ pos ] ; $ mask = chr ( 1 << $ bitPositionInByte ) ; $ filteredByte = $ mask & $ targetByte ; $ bitValue = 0 ; if ( ord ( $ filteredByte ) > 0 ) { $ bitValue = 1 ; } return $ bitValue ; }
Public for testing
@param type $byteString
@param type $bitPosition
@return type
Public for testing