public function generateVerifyCode(): string
    {
        if ($this->minLength > $this->maxLength) {
            $this->maxLength = $this->minLength;
        }
        if ($this->minLength < 3) {
            $this->minLength = 3;
        }
        if ($this->maxLength > 20) {
            $this->maxLength = 20;
        }
        $length = random_int($this->minLength, $this->maxLength);

        $letters = 'bcdfghjklmnpqrstvwxyz';
        $vowels = 'aeiou';
        $code = '';
        for ($i = 0; $i < $length; ++$i) {
            if (($i % 2 && random_int(0, 10) > 2) || (!($i % 2) && random_int(0, 10) > 9)) {
                $code .= $vowels[random_int(0, 4)];
            } else {
                $code .= $letters[random_int(0, 20)];
            }
        }

        return $code;
    }
public function generateVerifyCode(): string
    {
        if ($this->minLength > $this->maxLength) {
            $this->maxLength = $this->minLength;
        }
        if ($this->minLength < 3) {
            $this->minLength = 3;
        }
        if ($this->maxLength > 20) {
            $this->maxLength = 20;
        }
        $length = random_int($this->minLength, $this->maxLength);

        $letters = 'bcdfghjklmnpqrstvwxyz';
        $vowels = 'aeiou';
        $code = '';
        for ($i = 0; $i < $length; ++$i) {
            if (($i % 2 && random_int(0, 10) > 2) || (!($i % 2) && random_int(0, 10) > 9)) {
                $code .= $vowels[random_int(0, 4)];
            } else {
                $code .= $letters[random_int(0, 20)];
            }
        }

        return $code;
    }
public function generateVerifyCode ( ) : string { if ( $ this -> minLength > $ this -> maxLength ) { $ this -> maxLength = $ this -> minLength ; } if ( $ this -> minLength < 3 ) { $ this -> minLength = 3 ; } if ( $ this -> maxLength > 20 ) { $ this -> maxLength = 20 ; } $ length = random_int ( $ this -> minLength , $ this -> maxLength ) ; $ letters = 'bcdfghjklmnpqrstvwxyz' ; $ vowels = 'aeiou' ; $ code = '' ; for ( $ i = 0 ; $ i < $ length ; ++ $ i ) { if ( ( $ i % 2 && random_int ( 0 , 10 ) > 2 ) || ( ! ( $ i % 2 ) && random_int ( 0 , 10 ) > 9 ) ) { $ code .= $ vowels [ random_int ( 0 , 4 ) ] ; } else { $ code .= $ letters [ random_int ( 0 , 20 ) ] ; } } return $ code ; }
Generates new CAPTCHA code.
@return string CAPTCHA code.
@throws \Exception if it was not possible to gather sufficient entropy.
Generates new CAPTCHA code .