Returns a random string needed to generate a fileName for the queue.

@param int $count

@return string
559113
protected function getRandomString($count)
    {
        // This string MUST stay FS safe, avoid special chars
        $base = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-';
        $ret = '';
        $strlen = strlen($base);
        for ($i = 0; $i < $count; ++$i) {
            $ret .= $base[((int) rand(0, $strlen - 1))];
        }

        return $ret;
    }
178963
public static String s(int count) {
        StringBuilder result = new StringBuilder();

        for (int i = 0; i < count; i++) {
            result.append(" ");
        }
        return result.toString();
    }
849599
public static function pluralize(string $noun, ?int $count = null): string
	{
		if($count !== 1)
		{
			if(isset(static::$irregulars[$noun]))
			{
				$noun = static::$irregulars[$noun];
			}
			else
			{
				foreach(static::$pluralizationRules as $search => $replace)
				{
					if(preg_match($search, $noun))
					{
						$noun = preg_replace($search, $replace, $noun);

						break;
					}
				}
			}
		}

		return $noun;
	}
1177770
public function getRandomBytes($count)
    {
        $count = (int) $count;
        $bytes = '';
        $hasBytes = false;

		if (version_compare(PHP_VERSION, '7.0.0') >= 0 && function_exists('random_bytes'))
        {
            try
            {
                $bytes = \random_bytes($count);
                $hasBytes = true;
            }
            catch (\Exception $e)
            {
                //
            }
        }
        
        // Make sure PHP version is at least 5.3. We do this because
        // mcrypt_create_iv() on older versions of PHP
        // does not give "strong" random data on Windows systems.
        if (version_compare(PHP_VERSION, '5.3.0') >= 0 && function_exists('mcrypt_create_iv'))
        {
        	// Suppress deprecation warning in PHP 7.1
            $tmp = @mcrypt_create_iv($count, MCRYPT_DEV_URANDOM);
            if ($tmp !== false)
            {
                $bytes = $tmp;
                $hasBytes = true;
            }
        }

        if ($hasBytes === false && file_exists('/dev/urandom') && is_readable('/dev/urandom') && (false !== ($fh = fopen('/dev/urandom', 'rb'))))
        {
            if (function_exists('stream_set_read_buffer'))
            {
                stream_set_read_buffer($fh, 0);
            }

            $tmp = fread($fh, $count);
            fclose($fh);
            if ($tmp !== false)
            {
                $bytes = $tmp;
                $hasBytes = true;
            }
        }

        /*
         * We want to play it safe and disable openssl_random_pseudo_bytes() for now.
         * This is due to the OpenSSL "PID wrapping bug", which potentially could affect GenPhrase.
         *
        if ($hasBytes === false && version_compare(PHP_VERSION, '5.3.4') >= 0 && function_exists('openssl_random_pseudo_bytes'))
        {
            $tmp = openssl_random_pseudo_bytes($count, $cryptoStrong);
            if ($tmp !== false && $cryptoStrong === true)
            {
                $bytes = $tmp;
                $hasBytes = true;
            }
        }
        */

        if (isset($bytes[$count - 1]) && !isset($bytes[$count]))
        {
            return $bytes;
        }
        else
        {
            return false;
        }
    }
782317
public function generate(int $count = 100): Generator
    {
        for ($i = 0; $i < $count; $i++) {
            yield microtime(true);
        }
    }
868063
public function memoryUsage($key, $count = null) {
        return $this->returnCommand(['MEMORY', 'USAGE'], [$key], isset($count) ? [$key, 'SAMPLES', $count] : [$key]);
    }
81093
public static function right(string $string, int $count): string
    {
        return self::substr($string, -$count);
    }
80246
private function generateRandomHTML(int $count, array $tags, DemodataContext $context)
    {
        $output = '';
        for ($i = 0; $i < $count; ++$i) {
            $tag = Random::getRandomArrayElement($tags);
            $text = $context->getFaker()->words(random_int(1, 10), true);
            $output .= sprintf('<%1$s>%2$s</%1$s>', $tag, $text);
            $output .= '<br/>';
        }

        return $output;
    }
424147
private function getStatementContentAll($count = false)
    {
        $q = $this->connection->createQueryBuilder()
            ->select($count ? 'count(c.id)' : 'c.id')
            ->from('ezcontentobject', 'c')
            ->where('c.status = :status')
            ->setParameter('status', ContentInfo::STATUS_PUBLISHED, PDO::PARAM_INT);

        return $q->execute();
    }
984496
public function read($count)
    {
        $data = substr($this->content, $this->bytes_read, $count);
        $this->bytes_read  += $count;
        $this->lastAccessed = time();
        return $data;
    }
619806
private function getFractionDigitCount($count)
    {
        if ($this->precision > 0) {
            return $this->precision;
        }

        $target = gmp_init($this->target->getRadix());
        $maxFraction = gmp_pow(gmp_init($this->source->getRadix()), $count);
        $digits = 1;

        while (gmp_cmp(gmp_pow($target, $digits), $maxFraction) < 0) {
            $digits++;
        }

        return $digits - $this->precision;
    }
936613
public static function random($count = 8, $keys = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTWXYZ')
        {
            mt_srand((double)microtime() * 1000000);
            $random = [];
            $length = strlen($keys) - 1;
            for ($i = 0; $i < $count; ++$i) {
                $random[] = $keys[mt_rand(0, $length)];
            }
            return new static(implode('', $random));
        }
345247
public function read($count = 0)
    {
        if (0 === $count) {
            $count = -1;
        }
        fseek($this->resource, $this->readPosition);
        $content = stream_get_contents($this->resource, $count);
        $this->readPosition = ftell($this->resource);
        return $content;
    }
1272088
public static function getValues($count)
    {
        if (!Int::is($count) || $count < 1) {
            throw new \InvalidArgumentException("The \$count parameter must be of type int and greater than zero.");
        }

        $ret = [];
        $flag = 1;
        for ($i = 0; $i < $count; $i++) {
            $ret[] = $flag;
            $flag <<= 1;
        }

        return $ret;
    }
888905
public function append($count)
    {
        $bufferLen = strlen($this->buffer);

        if ($bufferLen >= $count + $this->maxAhead) {
            return $bufferLen;
        }

        ($ahead = $this->readAhead)
            && ($delta = $bufferLen - $ahead) < 0
            && $count -= $delta;

        $read = fread($this->handle, $count);
        if ($read === false) {
            throw new UnexpectedValueException(sprintf('Can not deal with fread() errors.'));
        }

        if ($readLen = strlen($read)) {
            $this->buffer .= $read;
            $bufferLen += $readLen;
        }

        return $bufferLen;
    }
303062
public function skip($count = 1)
    {
        for ($i = $count; $this->valid() && $i > 0; $i--) {
            $this->next();
        }

        return $this->valid();
    }
1348150
public function getCellsList($offset, $count)
    {
        //check whether workshett name is set or not
        if ($this->worksheetName == '')
            throw new Exception('Worksheet name not specified');
        $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() .
            '/worksheets/' . $this->worksheetName . '/cells?offset=' .
            $offset . '&count=' . $count;
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
        $json = json_decode($responseStream);
        $listCells = array();
        foreach ($json->Cells->CellList as $cell) {
            $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() .
                '/worksheets/' . $this->worksheetName . '/cells' . $cell->link->Href;
            $signedURI = Utils::sign($strURI);
            $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
            $json = json_decode($responseStream);
            array_push($listCells, $json->Cell);
        }
        return $listCells;

    }