Prado\Web\UI\WebControls\TCaptcha::getTokenImageOptions PHP Method

getTokenImageOptions() protected method

protected getTokenImageOptions ( ) : string
return string the options to be passed to the token image generator
    protected function getTokenImageOptions()
    {
        $privateKey = $this->getPrivateKey();
        // call this method to ensure private key is generated
        $token = $this->getToken();
        $options = array();
        $options['publicKey'] = $this->getPublicKey();
        $options['tokenLength'] = strlen($token);
        $options['caseSensitive'] = $this->getCaseSensitive();
        $options['alphabet'] = $this->getTokenAlphabet();
        $options['fontSize'] = $this->getTokenFontSize();
        $options['theme'] = $this->getTokenImageTheme();
        if (($randomSeed = $this->getViewState('RandomSeed', 0)) === 0) {
            $randomSeed = (int) (microtime() * 1000000);
            $this->setViewState('RandomSeed', $randomSeed);
        }
        $options['randomSeed'] = $this->getChangingTokenBackground() ? 0 : $randomSeed;
        $str = serialize($options);
        return base64_encode(md5($privateKey . $str) . $str);
    }