public function check($otp, $multi = false)
    {
        $otp = trim($otp);
        if (strlen($otp) < 32 || strlen($otp) > 48) {
            throw new \InvalidArgumentException('Invalid OTP length');
        }

        $this->setOtp($otp);
        $this->setYubikeyId();

        $clientId = $this->getClientId();
        if ($clientId === null) {
            throw new \InvalidArgumentException('Client ID cannot be null');
        }

        $nonce = $this->generateNonce();
        $params = array(
            'id' => $clientId,
            'otp' => $otp,
            'nonce' => $nonce,
            'timestamp' => '1'
        );
        ksort($params);

        $url = '/wsapi/2.0/verify?'.http_build_query($params).'&h='.$this->generateSignature($params);
        $hosts = ($multi === false) ? array(array_shift($this->hosts)) : $this->hosts;

        return $this->request($url, $hosts, $otp, $nonce);
    }