yii\captcha\CaptchaAction::generateValidationHash PHP Method

generateValidationHash() public method

Generates a hash code that can be used for client-side validation.
public generateValidationHash ( string $code ) : string
$code string the CAPTCHA code
return string a hash code generated from the CAPTCHA code
    public function generateValidationHash($code)
    {
        for ($h = 0, $i = strlen($code) - 1; $i >= 0; --$i) {
            $h += ord($code[$i]);
        }
        return $h;
    }