src/models/User.php
private function generateToken($length = 6)
    {
        $token = Yii::$app->security->generateRandomString($length);
        $replace = array_rand(range(2, 9));
        return str_replace(['-', '_', 'l', 1], $replace, strtolower($token));
    }
private function generateToken($length = 6)
    {
        $token = Yii::$app->security->generateRandomString($length);
        $replace = array_rand(range(2, 9));
        return str_replace(['-', '_', 'l', 1], $replace, strtolower($token));
    }
private function generateToken ( $ length = 6 ) { $ token = Yii :: $ app -> security -> generateRandomString ( $ length ) ; $ replace = array_rand ( range ( 2 , 9 ) ) ; return str_replace ( [ '-' , '_' , 'l' , 1 ] , $ replace , strtolower ( $ token ) ) ; }
Generate an easy readable random token.

@param number $length
@return mixed
@since 1.2.0
Generate an easy readable random token .