check the VAT identification number, country version for Greece.

@param pvatId vat id to check
@return true if checksum is ok
438455
private boolean checkGrVatId(final String pvatId) {
    final int checkSum = pvatId.charAt(10) - '0';
    final int sum = (pvatId.charAt(2) - '0') * 256 + (pvatId.charAt(3) - '0') * 128
        + (pvatId.charAt(4) - '0') * 64 + (pvatId.charAt(5) - '0') * 32
        + (pvatId.charAt(6) - '0') * 16 + (pvatId.charAt(7) - '0') * 8
        + (pvatId.charAt(8) - '0') * 4 + (pvatId.charAt(9) - '0') * 2;
    int calculatedCheckSum = sum % MODULO_11;
    if (calculatedCheckSum > 9) {
      calculatedCheckSum = 0;
    }
    return checkSum == calculatedCheckSum;
  }
841525
public boolean isZeroVATAllowed (@Nonnull final Locale aCountry, final boolean bUndefinedValue)
  {
    ValueEnforcer.notNull (aCountry, "Country");

    // first get locale specific VAT types
    final VATCountryData aVATCountryData = getVATCountryData (aCountry);
    return aVATCountryData != null ? aVATCountryData.isZeroVATAllowed () : bUndefinedValue;
  }
317028
private boolean checkFrVatId(final String pvatId) {
    final int checkSum = Integer.parseInt(pvatId.substring(2, 4));
    final int sum = Integer.parseInt(pvatId.substring(4));
    final int calculatedCheckSum = (12 + 3 * (sum % MODULO_97)) % MODULO_97;
    return checkSum == calculatedCheckSum;
  }
1312388
public static boolean checkSasAgreement(Platform platform, byte[] aMsg, int sasPos,
			int sasCount) {
		if (sasCount != 2)
			return false;
		
		boolean result =  (platform.getUtils().equals(SasType.B256.getType(), 0, aMsg, sasPos , 4)  &&
			    platform.getUtils().equals(SasType.B32.getType(), 0, aMsg, sasPos + 1 * 4, 4));
		
		return result;
	}
1108595
public boolean isValidSignature(final Key key) {
        final byte[] computedHmac = key.sign(getVersion(), getTimestamp(), getInitializationVector(),
                getCipherText());
        return Arrays.equals(getHmac(), computedHmac);
    }
797540
private boolean checkSiVatId(final String pvatId) {
    boolean checkSumOk;
    final int checkSum = pvatId.charAt(9) - '0';
    final int sum = (pvatId.charAt(2) - '0') * 8 + (pvatId.charAt(3) - '0') * 7
        + (pvatId.charAt(4) - '0') * 6 + (pvatId.charAt(5) - '0') * 5 + (pvatId.charAt(6) - '0') * 4
        + (pvatId.charAt(7) - '0') * 3 + (pvatId.charAt(8) - '0') * 2;
    int calculatedCheckSum = MODULO_11 - sum % MODULO_11;
    if (calculatedCheckSum == 11) {
      checkSumOk = false;
    } else {
      if (calculatedCheckSum == 10) {
        calculatedCheckSum = 0;
      }
      checkSumOk = checkSum == calculatedCheckSum;
    }
    return checkSumOk;
  }
317668
function isValid(number, countryCode) {
    try {
        var phoneUtil = i18n.phonenumbers.PhoneNumberUtil.getInstance();
        var numberObj = phoneUtil.parseAndKeepRawInput(number, countryCode);
        return phoneUtil.isValidNumber(numberObj);
    } catch (e) {
        return false;
    }
}
1100014
private function validateBusiness(string $vatNumber): bool
    {
        $weights = [1, 2, 3, 4, 5, 6, 7, 8];
        $checkval = $this->sumWeights($weights, $vatNumber);

        if ($checkval % 11 == 10) {
            $weights = [3, 4, 5, 6, 7, 8, 9, 10];
            $checkval = $this->sumWeights($weights, $vatNumber);

            $checkval = ($checkval % 11) == 10 ? 0 : ($checkval % 11);
        } else {
            $checkval = $checkval % 11;
        }

        return $checkval == (int) $vatNumber[8];
    }
1256552
public function validateVATID($vat_id)
    {
        try {
            $isValid = $this->calculator->isValidVATNumber($vat_id);
            $message = '';
        } catch (VATCheckUnavailableException $e) {
            $isValid = false;
            $message = $e->getMessage();
        }

        return [
            'vat_id'   => $vat_id,
            'is_valid' => $isValid,
            'message'  => $message,
        ];
    }
341832
private function validateNational(string $vatNumber): int
    {
        $checkval = 0;

        for ($i = 2; $i <= 8; $i++) {
            $checkval += $this->crossSum((int)$vatNumber[9 - $i] * ($this->isEven($i) ? 2 : 1));
        }

        $checkval = 10 - ($checkval % 10);

        return $checkval % 10;
    }
1307304
boolean checkIntegrity () {
        if (headerType == null) return false;
        if (headerType == HeaderType.MODE_PARAMETER_HEADER_6 && longLba) return false;
        return true;
    }
351226
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString = Objects.toString(pvalue, null);
    if (StringUtils.isEmpty(valueAsString)) {
      return true;
    }
    if (valueAsString.length() != ISIN_LENGTH) {
      // ISIN size is wrong, but that's handled by size annotation
      return true;
    }
    // calculate and check checksum (ISIN)
    return CHECK_ISIN.isValid(valueAsString);
  }
999553
private static boolean verifyChecksum(final String hrp, final byte[] values) {
        byte[] hrpExpanded = expandHrp(hrp);
        byte[] combined = new byte[hrpExpanded.length + values.length];
        System.arraycopy(hrpExpanded, 0, combined, 0, hrpExpanded.length);
        System.arraycopy(values, 0, combined, hrpExpanded.length, values.length);
        return polymod(combined) == 1;
    }
1218235
private function _checkVAT(&$vat)
    {
        if (!isset($vat)) {
            throw new Klarna_ArgumentNotSetException("VAT");
        }
        if (is_numeric($vat) && (!is_int($vat) || !is_float($vat))) {
            $vat = floatval($vat);
        }
        if (!is_numeric($vat) || (!is_int($vat) && !is_float($vat))) {
            throw new Klarna_InvalidTypeException("VAT", "integer or float");
        }
    }
1290516
private boolean checkModulo11TaxNumber(final String ptaxNumber) {
    final int checkSum = ptaxNumber.charAt(ptaxNumber.length() - 1) - '0';
    int sum = 10;
    for (int i = 0; i < ptaxNumber.length() - 1; i++) {
      int summe = (ptaxNumber.charAt(i) - '0' + sum) % 10;
      if (summe == 0) {
        summe = 10;
      }
      sum = 2 * summe % MODULO_11;
    }
    int calculatedCheckSum = MODULO_11 - sum;
    if (calculatedCheckSum == 10) {
      calculatedCheckSum = 0;
    }
    return checkSum == calculatedCheckSum;
  }
191555
public function validate(\OxidEsales\Eshop\Application\Model\CompanyVatIn $vatIn)
    {
        $result = false;
        $country = $this->getCountry();
        if (!is_null($country)) {
            $result = ($country->getVATIdentificationNumberPrefix() === $vatIn->getCountryCode());
            if (!$result) {
                $this->setError(self::ERROR_ID_NOT_VALID);
            }
        }

        return $result;
    }
1216451
private final boolean checkHeader(int signature)
    {
        // check the signature
        // Trie in big-endian US-ASCII (0x54726965).
        // Magic number to authenticate the data.
        if (signature != HEADER_SIGNATURE_) {
            return false;
        }

        if ((m_options_ & HEADER_OPTIONS_SHIFT_MASK_) !=
                                                    INDEX_STAGE_1_SHIFT_ ||
            ((m_options_ >> HEADER_OPTIONS_INDEX_SHIFT_) &
                                                HEADER_OPTIONS_SHIFT_MASK_)
                                                 != INDEX_STAGE_2_SHIFT_) {
            return false;
        }
        return true;
    }