public function verify(string $otp, ?int $counter = null, ?int $window = null): bool
    {
        Assertion::greaterOrEqualThan($counter, 0, 'The counter must be at least 0.');

        if (null === $counter) {
            $counter = $this->getCounter();
        } elseif ($counter < $this->getCounter()) {
            return false;
        }

        return $this->verifyOtpWithWindow($otp, $counter, $window);
    }