public function generate($length)
    {
        $realPool = $this->mergePools($this->characterPools);
        $max = (count($realPool) - 1);
        mt_srand();

        $randomString = '';

        for ($i = 0; $i < $length; $i++) {
            $randomString .= $realPool[mt_rand(0, $max)];
        }

        return $randomString;
    }
public function generate($length)
    {
        $realPool = $this->mergePools($this->characterPools);
        $max = (count($realPool) - 1);
        mt_srand();

        $randomString = '';

        for ($i = 0; $i < $length; $i++) {
            $randomString .= $realPool[mt_rand(0, $max)];
        }

        return $randomString;
    }
public function generate ( $ length ) { $ realPool = $ this -> mergePools ( $ this -> characterPools ) ; $ max = ( count ( $ realPool ) - 1 ) ; mt_srand ( ) ; $ randomString = '' ; for ( $ i = 0 ; $ i < $ length ; $ i ++ ) { $ randomString .= $ realPool [ mt_rand ( 0 , $ max ) ] ; } return $ randomString ; }
Generates a random string with the given length based on the character pools.

@param int $length Length of the result string.

@return string
Generates a random string with the given length based on the character pools .