func New(countryCode string, BBAN string) (IBAN, error) {
	if len(countryCode) != 2 {
		return "", fmt.Errorf("malformed countryCode: must have two characters")
	}
	countryCode = strings.ToUpper(countryCode)

	ibanLen, ok := ibanMaxLengthForCountry[countryCode]
	if !ok {
		ibanLen = maxAllowedIBANLength
	}
	if len(BBAN) == 0 {
		return "", fmt.Errorf("missing BBAN")
	}
	if len(BBAN) > (ibanLen - 4) {
		return "", fmt.Errorf("malformed BBAN: must have at max %d characters", ibanLen)
	}

	BBAN = strings.ToUpper(BBAN)

	step1 := fmt.Sprintf("%s%s00", transformLettersToDigits(BBAN), transformLettersToDigits(countryCode))
	step2, ok := new(big.Int).SetString(step1, 10)
	if !ok {
		return "", fmt.Errorf("Malformed iban string: %s", step1)
	}
	step3 := step2.Mod(step2, big.NewInt(97))
	proofNumber := new(big.Int).Sub(big.NewInt(98), step3)

	iban := fmt.Sprintf("%s%02d%s", countryCode, proofNumber.Int64(), BBAN)
	return IBAN(iban), nil
}
// New returns a new IBAN for the provided countryCode and BBAN
New returns a new IBAN for the provided countryCode and BBAN
// New returns a new IBAN for the provided countryCode and BBAN
func New(countryCode string, BBAN string) (IBAN, error) {
	if len(countryCode) != 2 {
		return "", fmt.Errorf("malformed countryCode: must have two characters")
	}
	countryCode = strings.ToUpper(countryCode)
	ibanLen, ok := ibanMaxLengthForCountry[countryCode]
	if !ok {
		ibanLen = maxAllowedIBANLength
	}
	if len(BBAN) == 0 {
		return "", fmt.Errorf("missing BBAN")
	}
	if len(BBAN) > (ibanLen - 4) {
		return "", fmt.Errorf("malformed BBAN: must have at max %d characters", ibanLen)
	}
	BBAN = strings.ToUpper(BBAN)
	step1 := fmt.Sprintf("%s%s00", transformLettersToDigits(BBAN), transformLettersToDigits(countryCode))
	step2, ok := new(big.Int).SetString(step1, 10)
	if !ok {
		return "", fmt.Errorf("Malformed iban string: %s", step1)
	}
	step3 := step2.Mod(step2, big.NewInt(97))
	proofNumber := new(big.Int).Sub(big.NewInt(98), step3)
	iban := fmt.Sprintf("%s%02d%s", countryCode, proofNumber.Int64(), BBAN)
	return IBAN(iban), nil
}
func New ( countryCode string , BBAN string ) ( IBAN , error ) { if len ( countryCode ) != 2 { return " " , fmt . Errorf ( " " ) } countryCode = strings . ToUpper ( countryCode ) ibanLen , ok := ibanMaxLengthForCountry [ countryCode ] if ! ok { ibanLen = maxAllowedIBANLength } if len ( BBAN ) == 0 { return " " , fmt . Errorf ( " " ) } if len ( BBAN ) > ( ibanLen - 4 ) { return " " , fmt . Errorf ( " " , ibanLen ) } BBAN = strings . ToUpper ( BBAN ) step1 := fmt . Sprintf ( " " , transformLettersToDigits ( BBAN ) , transformLettersToDigits ( countryCode ) ) step2 , ok := new ( big . Int ) . SetString ( step1 , 10 ) if ! ok { return " " , fmt . Errorf ( " " , step1 ) } step3 := step2 . Mod ( step2 , big . NewInt ( 97 ) ) proofNumber := new ( big . Int ) . Sub ( big . NewInt ( 98 ) , step3 ) iban := fmt . Sprintf ( " " , countryCode , proofNumber . Int64 ( ) , BBAN ) return IBAN ( iban ) , nil }
New returns a new IBAN for the provided countryCode and BBAN
New returns a new IBAN for the provided countryCode and BBAN