Documentation
¶
Index ¶
Constants ¶
View Source
const ( AlphaRange = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" NumericRange = "0123456789" AlphanumericRange = AlphaRange + NumericRange )
Variables ¶
View Source
var ( ErrTooShort = errors.New("IBAN too short") ErrTooLong = errors.New("IBAN too long") ErrInvalidCountry = errors.New("invalid or unknown IBAN country") ErrInvalidChecksum = errors.New("invalid IBAN checksum") ErrInvalidBankLength = errors.New("invalid IBAN bank id length") ErrInvalidBranchLength = errors.New("invalid IBAN branch id length") ErrInvalidAccountLength = errors.New("invalid IBAN account id length") )
Functions ¶
func RandomValue ¶
RandomValue return a low quality random value suitable for account numbers etc
func SetRandomSeed ¶
func SetRandomSeed(n int64)
SetRandomSeed must not need to be used in normal operations, and is only useful to have tests that can be reproduced. By default we will use UnixNano() to initialize our random seed, so you really don't need to call this.
Types ¶
type IBAN ¶
type IBAN struct {
Country string // 2 letters
Check string // 2 digits
Bank string // bank code
Branch string // branch or sort code
Account string // account number
}
func (*IBAN) Checksum ¶
Checksum will compute the appropriate checksum value for the current iban value and return it.
func (*IBAN) CompactString ¶
CompactString returns a IBAN without any spaces/etc
func (*IBAN) SetChecksum ¶
SetChecksum will update the IBAN's checksum value to ensure it is valid
func (*IBAN) SetRandomAccount ¶
Click to show internal directories.
Click to hide internal directories.