src/Model/PasswordAndTokenTrait.php
public function generateToken($length = 10, $chars = '0123456789abcdefghijklmnopqrstuvwxyz') {
		$token = '';
		$i = 0;
		while ($i < $length) {
			$char = substr($chars, mt_rand(0, strlen($chars) - 1), 1);
			if (!stristr($token, $char)) {
				$token .= $char;
				$i++;
			}
		}

		return $token;
	}
public function generateToken($length = 10, $chars = '0123456789abcdefghijklmnopqrstuvwxyz') {
		$token = '';
		$i = 0;
		while ($i < $length) {
			$char = substr($chars, mt_rand(0, strlen($chars) - 1), 1);
			if (!stristr($token, $char)) {
				$token .= $char;
				$i++;
			}
		}

		return $token;
	}
public function generateToken ( $ length = 10 , $ chars = '0123456789abcdefghijklmnopqrstuvwxyz' ) { $ token = '' ; $ i = 0 ; while ( $ i < $ length ) { $ char = substr ( $ chars , mt_rand ( 0 , strlen ( $ chars ) - 1 ) , 1 ) ; if ( ! stristr ( $ token , $ char ) ) { $ token .= $ char ; $ i ++ ; } } return $ token ; }
Generate token used by the user registration system

@param int $length Token Length
@param string $chars Characters used in the token
@return string
Generate token used by the user registration system