public function generateCode()
    {
        $this->digits[0] = rand(0, 9);
        $this->digits[1] = rand(0, 9);
        $this->digits[2] = rand(0, 9);
        $this->digits[3] = rand(0, 9);
        $this->digits[4] = rand(0, 9);
        $this->value = $this->digits[0] * 10000 + $this->digits[1] * 1000;
        $this->value += $this->digits[2] * 100 + $this->digits[3] * 10 + $this->digits[4];
        $this->xorValue = $this->value ^ $this->config->codeKey;
        $_SESSION['captcha'] = $this->xorValue;

        return $this;
    }