iban

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

README

ibangen

A CLI tool written in Golang for generating IBANs. For testing purposes only.

Installation

go install github.com/vlasebian/ibangen/cmd/ibangen@v1.0.0

Usage

ibangen Supported country codes: 'nl' (Netherlands) 'ie' (Ireland) 'at' (Austria) 'ch' (Switzerland) 'es' (Spain) 'it' (Italy) 'de' (Germany) 'be' (Belgium) 'fr' (France)

ibangen --help
ibangen
ibangen nl

Documentation

Index

Constants

View Source
const (
	CountryCodeNetherlands = "NL"
	CountryCodeGermany     = "DE"
	CountryCodeAustria     = "AT"
	CountryCodeSwitzerland = "CH"
	CountryCodeBelgium     = "BE"
	CountryCodeIreland     = "IE"
	CountryCodeSpain       = "ES"
	CountryCodeFrance      = "FR"
	CountryCodeItaly       = "IT"

	IBANLengthNetherlands = 18
	IBANLengthGermany     = 22
	IBANLengthAustria     = 20
	IBANLengthSwitzerland = 21
	IBANLengthBelgium     = 16
	IBANLengthIreland     = 22
	IBANLengthSpain       = 24
	IBANLengthFrance      = 27
	IBANLengthItaly       = 27
)
View Source
const IBANMaxLength = 34

Variables

View Source
var Generators map[string]Generator = map[string]Generator{
	CountryCodeNetherlands: GenericGenerator{CountryCode: CountryCodeNetherlands, Banks: dutchBanks, AccountNumberLength: IBANLengthNetherlands},
	CountryCodeGermany:     GenericGenerator{CountryCode: CountryCodeGermany, Banks: germanBanks, AccountNumberLength: IBANLengthGermany},
	CountryCodeIreland:     GenericGenerator{CountryCode: CountryCodeIreland, Banks: irishBanks, AccountNumberLength: IBANLengthIreland},
	CountryCodeAustria:     GenericGenerator{CountryCode: CountryCodeAustria, Banks: austrianBanks, AccountNumberLength: IBANLengthAustria},
	CountryCodeSwitzerland: GenericGenerator{CountryCode: CountryCodeSwitzerland, Banks: swissBanks, AccountNumberLength: IBANLengthSwitzerland},

	CountryCodeBelgium: BelgiumGenerator{},
	CountryCodeSpain:   SpainGenerator{},
	CountryCodeFrance:  FranceGenerator{},
	CountryCodeItaly:   ItalyGenerator{},
}

Functions

This section is empty.

Types

type BelgiumGenerator

type BelgiumGenerator struct{}

func (BelgiumGenerator) Generate

func (g BelgiumGenerator) Generate() IBAN

type FranceGenerator

type FranceGenerator struct{}

func (FranceGenerator) Generate

func (g FranceGenerator) Generate() IBAN

type Generator

type Generator interface {
	Generate() IBAN
}

type GenericGenerator

type GenericGenerator struct {
	CountryCode         string
	Banks               []bank
	AccountNumberLength int
}

DutchIBANGenerator generates IBANs for countries that do not have a checksum for the account number and only use the IBAN checksum.

func (GenericGenerator) Generate

func (g GenericGenerator) Generate() IBAN

type IBAN

type IBAN []byte

International Bank Account Number.

func FromString

func FromString(s string) (IBAN, error)

func NewIBAN

func NewIBAN(countryCode, bban string) IBAN

func (IBAN) BBAN

func (i IBAN) BBAN() string

func (IBAN) CheckDigits

func (i IBAN) CheckDigits() string

func (IBAN) CountryCode

func (i IBAN) CountryCode() string

func (IBAN) IsValid

func (i IBAN) IsValid() bool

func (IBAN) String

func (i IBAN) String() string

type ItalyGenerator

type ItalyGenerator struct{}

func (ItalyGenerator) Generate

func (g ItalyGenerator) Generate() IBAN

type SpainGenerator

type SpainGenerator struct{}

func (SpainGenerator) Generate

func (g SpainGenerator) Generate() IBAN

Directories

Path Synopsis
cmd
ibangen command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL