private function getByteNumber($limit)
    {
        $bits = 1;
        $mask = 1;

        while ($limit >> $bits > 0) {
            $mask |= 1 << $bits;
            $bits++;
        }

        $bytes = (int) ceil($bits / 8);

        do {
            $result = $this->readByteNumber($bytes) & $mask;
        } while ($result > $limit);

        return $result;
    }
private function getByteNumber($limit)
    {
        $bits = 1;
        $mask = 1;

        while ($limit >> $bits > 0) {
            $mask |= 1 << $bits;
            $bits++;
        }

        $bytes = (int) ceil($bits / 8);

        do {
            $result = $this->readByteNumber($bytes) & $mask;
        } while ($result > $limit);

        return $result;
    }
private function getByteNumber ( $ limit ) { $ bits = 1 ; $ mask = 1 ; while ( $ limit >> $ bits > 0 ) { $ mask |= 1 << $ bits ; $ bits ++ ; } $ bytes = ( int ) ceil ( $ bits / 8 ) ; do { $ result = $ this -> readByteNumber ( $ bytes ) & $ mask ; } while ( $ result > $ limit ) ; return $ result ; }
Returns a random number generated using the random byte generator.
@param int $limit Maximum value for the random number
@return int The generated random number between 0 and the limit
@throws GeneratorException If error occurs generating the random number
Returns a random number generated using the random byte generator .