Returns the next 9, 10, 11 or 12 bits.

@return integer
486818
protected function getNextCode()
    {
        if ($this->bytePointer === $this->dataLength) {
            return 257;
        }

        $this->nextData = ($this->nextData << 8) | (\ord($this->data[$this->bytePointer++]) & 0xff);
        $this->nextBits += 8;

        if ($this->nextBits < $this->bitsToGet) {
            $this->nextData = ($this->nextData << 8) | (\ord($this->data[$this->bytePointer++]) & 0xff);
            $this->nextBits += 8;
        }

        $code = ($this->nextData >> ($this->nextBits - $this->bitsToGet)) & $this->andTable[$this->bitsToGet - 9];
        $this->nextBits -= $this->bitsToGet;

        return $code;
    }
378563
public function get10()
    {
        // Is it valid?
        if ($this->isValid()) {
            // Is it already an ISBN-10?  If so, return as-is.
            if (strlen($this->raw) == 10) {
                return $this->raw;
            } elseif (strlen($this->raw) == 13
                && substr($this->raw, 0, 3) == '978'
            ) {
                // Is it a Bookland EAN?  If so, we can convert to ISBN-10.
                $start = substr($this->raw, 3, 9);
                return $start . self::getISBN10CheckDigit($start);
            }
        }

        // If we made it this far, conversion was not possible:
        return false;
    }
758371
protected function gerarNossoNumero()
    {
        $numero_boleto = $this->getNumero();
        return Util::numberFormatGeral($numero_boleto, 12)
            . CalculoDV::santanderNossoNumero($numero_boleto);
    }
297077
public function readU29() {

            $count = 1;
            $u29 = 0;

            $byte = $this->stream->readByte();
  
            while((($byte & 0x80) != 0) && $count < 4) {
                $u29 <<= 7;
                $u29 |= ($byte & 0x7f);
                $byte = $this->stream->readByte();
                $count++;
            }
            
            if ($count < 4) {
                $u29 <<= 7;
                $u29 |= $byte;
            } else {
                // Use all 8 bits from the 4th byte
                $u29 <<= 8;
                $u29 |= $byte;
            }
            
            return $u29;
         
        }
131077
public function toBytes()
    {
        if (0 === gmp_cmp($this->value, gmp_init(0))) {
            return '';
        }

        $temp = gmp_strval(gmp_abs($this->value), 16);
        $temp = mb_strlen($temp, '8bit') & 1 ? '0'.$temp : $temp;
        $temp = hex2bin($temp);

        return ltrim($temp, chr(0));
    }
993924
public static function gerar()
    {
        $cpf = array ();
        for ($i = 0; $i < 9; $i++) {
            $cpf[$i] = rand(0, 9);
        }

        // Primeiro dígito
        $soma = 0;
        for ($i = 0; $i < 9; $i++) {
            $soma += ((10 - $i) * $cpf[$i]);
        }
        $d1 = 11 - ($soma % 11);
        if ($d1 >= 10) {
            $d1 = 0;
        }
        $cpf[9] = $d1;

        // Segundo Dígito
        $soma = 0;
        for ($i = 0; $i < 10; $i++) {
            $soma += ((11 - $i) * $cpf[$i]);
        }
        $d2 = 11 - ($soma % 11);
        if ($d2 >= 10) {
            $d2 = 0;
        }
        $cpf[10] = $d2;

        return static::formatar(implode("", $cpf));
    }
1226463
public function currentLine() {
        if (empty($this->EOF) || $this->char == 0) {
            return 1;
        }
        // Add one to $this->char because we want the number for the next
        // byte to be processed.
        return substr_count($this->data, "\n", 0, min($this->char, $this->EOF)) + 1;
    }
771964
public function next():int
    {
        $timestamp = $this->milliTime();
        if ($timestamp < $this->_lastTimestamp) {
            throw new Exception(sprintf("Clock moved backwards.  Refusing to generate id for %d milliseconds", $this->_lastTimestamp - $timestamp));
        }
        if ($this->_lastTimestamp == $timestamp) {
            $this->_sequence = ($this->_sequence + 1) & self::SEQUENCE_MASK;
            if ($this->_sequence == 0) {
                $timestamp = $this->waitNextMilli($this->_lastTimestamp);
            }
        } else {
            $this->_sequence = 0;
        }
        $this->_lastTimestamp = $timestamp;
        return (($timestamp - $this->epoch) << self::TIMESTAMP_LEFT_SHIFT)
            | ($this->dataCenterId << self::DATA_CENTER_ID_SHIFT)
            | ($this->workerId << self::WORKER_ID_SHIFT)
            | $this->_sequence;
    }
622939
public int nextBit(int x) {
        Assert.check(currentState != BitsState.UNKNOWN);
        int windex = x >>> wordshift;
        if (windex >= bits.length) {
            return -1;
        }
        int word = bits[windex] & ~((1 << (x & wordmask))-1);
        while (true) {
            if (word != 0) {
                return (windex << wordshift) + trailingZeroBits(word);
            }
            windex++;
            if (windex >= bits.length) {
                return -1;
            }
            word = bits[windex];
        }
    }
663416
private function doCountBin()
    {
        $count   = 0;
        $bitset  = $this->bitset;
        $byteLen = \strlen($bitset);
        for ($bytePos = 0; $bytePos < $byteLen; ++$bytePos) {
            if ($bitset[$bytePos] === "\0") {
                // fast skip null byte
                continue;
            }

            $ord = \ord($bitset[$bytePos]);
            if ($ord & 0b00000001) ++$count;
            if ($ord & 0b00000010) ++$count;
            if ($ord & 0b00000100) ++$count;
            if ($ord & 0b00001000) ++$count;
            if ($ord & 0b00010000) ++$count;
            if ($ord & 0b00100000) ++$count;
            if ($ord & 0b01000000) ++$count;
            if ($ord & 0b10000000) ++$count;
        }
        return $count;
    }
444857
public function eatNum()
    {
        $ln = QRspec::lengthIndicator(Constants::QR_MODE_NUM, $this->input->getVersion());

        $p = 0;
        while(self::isdigitat($this->dataStr, $p)) {
            $p++;
        }

        $run = $p;
        $mode = $this->identifyMode($p);

        if($mode == Constants::QR_MODE_8) {
            $dif = QRinput::estimateBitsModeNum($run) + 4 + $ln
                 + QRinput::estimateBitsMode8(1)         // + 4 + l8
                 - QRinput::estimateBitsMode8($run + 1); // - 4 - l8
            if($dif > 0) {
                return $this->eat8();
            }
        }
        if($mode == Constants::QR_MODE_AN) {
            $dif = QRinput::estimateBitsModeNum($run) + 4 + $ln
                 + QRinput::estimateBitsModeAn(1)        // + 4 + la
                 - QRinput::estimateBitsModeAn($run + 1);// - 4 - la
            if($dif > 0) {
                return $this->eatAn();
            }
        }

        $ret = $this->input->append(Constants::QR_MODE_NUM, $run, str_split($this->dataStr));
        if($ret < 0)
            return -1;

        return $run;
    }
1206382
public function getNextSet(int $from) : int
    {
        if ($from >= $this->size) {
            return $this->size;
        }

        $bitsOffset = $from >> 5;
        $currentBits = $this->bits[$bitsOffset];
        $bitsLength = count($this->bits);
        $currentBits &= ~((1 << ($from & 0x1f)) - 1);

        while (0 === $currentBits) {
            if (++$bitsOffset === $bitsLength) {
                return $this->size;
            }

            $currentBits = $this->bits[$bitsOffset];
        }

        $result = ($bitsOffset << 5) + BitUtils::numberOfTrailingZeros($currentBits);
        return $result > $this->size ? $this->size : $result;
    }
204847
private function doCountInt()
    {
        $count  = 0;
        $bitset = $this->bitset;

        // PHP does not support right shift unsigned
        if ($bitset < 0) {
            $count  = 1;
            $bitset = $bitset & \PHP_INT_MAX;
        }

        // iterate byte by byte and count set bits
        $phpIntBitSize = \PHP_INT_SIZE * 8;
        for ($bitPos = 0; $bitPos < $phpIntBitSize; $bitPos += 8) {
            $bitChk = 0xff << $bitPos;
            $byte = $bitset & $bitChk;
            if ($byte) {
                $byte = $byte >> $bitPos;
                if ($byte & 0b00000001) ++$count;
                if ($byte & 0b00000010) ++$count;
                if ($byte & 0b00000100) ++$count;
                if ($byte & 0b00001000) ++$count;
                if ($byte & 0b00010000) ++$count;
                if ($byte & 0b00100000) ++$count;
                if ($byte & 0b01000000) ++$count;
                if ($byte & 0b10000000) ++$count;
            }

            if ($bitset <= $bitChk) {
                break;
            }
        }

        return $count;
    }
1079028
public function getNumbers()
    {
        return (string) \OxidEsales\Eshop\Core\Str::getStr()->substr($this->_cleanUp($this->_sCompanyVatNumber), 2);
    }
957033
public static function v4()
    {
        return
            // 32 bits for "time_low"
            bin2hex(Yii::$app->security->generateRandomKey(4)) . "-" .
            // 16 bits for "time_mid"
            bin2hex(Yii::$app->security->generateRandomKey(2)) . "-" .
            // 16 bits for "time_hi_and_version",
            // four most significant bits holds version number 4
            dechex(mt_rand(0, 0x0fff) | 0x4000) . "-" .
            // 16 bits, 8 bits for "clk_seq_hi_res",
            // 8 bits for "clk_seq_low",
            // two most significant bits holds zero and one for variant DCE1.1
            dechex(mt_rand(0, 0x3fff) | 0x8000) . "-" .
            // 48 bits for "node"
            bin2hex(Yii::$app->security->generateRandomKey(6));
    }
1125017
public function next() {
        if (is_int($this->current)) {
            return $this->get($this->current + 1);
        }

        return $this->first;
    }
771042
protected function get12hHour() : int
   {

      if ( $this->isAnteMeridiem() )
      {
         return $this->getHour();
      }

      if ( $this->properties[ 'hour' ] == 0 )
      {
         return 12;
      }

      if ( $this->properties[ 'hour' ] > 12 )
      {
         return $this->properties[ 'hour' ] - 12;
      }

      return $this->properties[ 'hour' ];

   }