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;
    }