Giter Club home page Giter Club logo

iban-2's Introduction

iban

GoLang IBAN Validation module

The separate BBAN ckeck is not yet implemented. This is needed for the countries where the IBAN ckecksum is a constant. Currently the validation will work but the constant is not checked and neiter the BBAN. Concerned countries: Macedonia, Bosnia and Herzegovina, East Timor, Mauritania, Montenegro, Portugal, Slovenia, Tunisia

The IBAN may be formated with spaces. Letter cases are ignored.

Here a small sample to test it.

package main

import (
	"fmt"
	"github.com/go-pascal/iban"
)

func main() {

	var OK, well_formated, err = iban.IsCorrectIban("GB82 WEST 1234 5698 7654 32 ", true) // passed: IBAN string , debug true/false
	if err != nil {
		fmt.Println(err.Error())
	} else {

		if OK {
			fmt.Printf("IBAN %s is valid \n\r", well_formated)
		} else {
			fmt.Println("IBAN is not valid")
		}
	}

	var ck, err2 = iban.GetIbanChecksum("GB00 WEST 1234 5698 7654 32 ")
	if err2 != nil {
		fmt.Println(err2.Error())
	} else {

		fmt.Println("IBAN checksum :", ck)
	}
}
package main

import "github.com/RitchieFlick/iban"
import "log"

func main() {
	iban, err := iban.NewIBAN("GB82WEST12345698765432")
	if err != nil {
		log.Print(err)
	}
	log.Print(iban.Number)
}

iban-2's People

Contributors

antosdaniel avatar pascal-csl avatar ritoon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.