func (i IBAN) Valid() bool {
	if len(i) > maxAllowedIBANLength {
		return false
	}
	countryCode := i.CountryCode()
	countryCode = strings.ToUpper(countryCode)
	bban := i.BBAN()
	bban = strings.ToUpper(bban)

	digitCountryCode := transformLettersToDigits(countryCode)
	digitBBAN := transformLettersToDigits(bban)
	checkSumString := fmt.Sprintf("%s%s%s", digitBBAN, digitCountryCode, i.ProofNumber())
	checkSum, ok := new(big.Int).SetString(checkSumString, 10)
	if !ok {
		return false
	}
	mod := checkSum.Mod(checkSum, big.NewInt(97))
	return mod.Cmp(big.NewInt(1)) == 0
}
// Valid returns true if the IBAN is valid, false otherwise
Valid returns true if the IBAN is valid, false otherwise
// Valid returns true if the IBAN is valid false otherwise
func (i IBAN) Valid() bool {
	if len(i) > maxAllowedIBANLength {
		return false
	}
	countryCode := i.CountryCode()
	countryCode = strings.ToUpper(countryCode)
	bban := i.BBAN()
	bban = strings.ToUpper(bban)
	digitCountryCode := transformLettersToDigits(countryCode)
	digitBBAN := transformLettersToDigits(bban)
	checkSumString := fmt.Sprintf("%s%s%s", digitBBAN, digitCountryCode, i.ProofNumber())
	checkSum, ok := new(big.Int).SetString(checkSumString, 10)
	if !ok {
		return false
	}
	mod := checkSum.Mod(checkSum, big.NewInt(97))
	return mod.Cmp(big.NewInt(1)) == 0
}
func ( i IBAN ) Valid ( ) bool { if len ( i ) > maxAllowedIBANLength { return false } countryCode := i . CountryCode ( ) countryCode = strings . ToUpper ( countryCode ) bban := i . BBAN ( ) bban = strings . ToUpper ( bban ) digitCountryCode := transformLettersToDigits ( countryCode ) digitBBAN := transformLettersToDigits ( bban ) checkSumString := fmt . Sprintf ( " " , digitBBAN , digitCountryCode , i . ProofNumber ( ) ) checkSum , ok := new ( big . Int ) . SetString ( checkSumString , 10 ) if ! ok { return false } mod := checkSum . Mod ( checkSum , big . NewInt ( 97 ) ) return mod . Cmp ( big . NewInt ( 1 ) ) == 0 }
Valid returns true if the IBAN is valid, false otherwise
Valid returns true if the IBAN is valid false otherwise