src/Sasedev/Commons/SharedBundle/Model/BaseUser.php
public static function generateRandomChar($length, $charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#@!?+=*/-')
	{
		$str = '';
		$count = strlen($charset);
		while ($length --) {
			$str .= $charset[mt_rand(0, $count - 1)];
		}
		
		return $str;
	}
public static function generateRandomChar($length, $charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#@!?+=*/-')
	{
		$str = '';
		$count = strlen($charset);
		while ($length --) {
			$str .= $charset[mt_rand(0, $count - 1)];
		}
		
		return $str;
	}
Get a random char (for generated password)

@param integer $length
@param string $charset

@return string