Boringly simple parsing and validation for various notations.
- π¦ BICs
- π° IBANs with country-specific BBAN validation
- π΄ββ οΈ ISO3166-1 Alpha2 (e.g.
DE
, orES
) - π German Health Insurance Numbers (Krankenversicherungsnummern)
- π§ German Pension Insurance Numbers (Renten-/ Sozialversicherungsnummern)
- π² German Tax Identification Numbers (Steuer-IDs)
- β German Postal Codes (Postleitzahlen)
Each standard is implemented in its own package,
and each package provides a type for the standard, e.g. bic.BIC
for BICs.
That type contains all the information that can be extracted from the notation.
package bic
type BIC struct {
BusinessPartyPrefix string
CountryCode string
BusinessPartySuffix string
BranchCode string
}
Each type implements:
String() string
to get the notation pretty-printedCompact() string
to get the notation in compact, machine-readable formMarshalText() ([]byte, error)
same asCompact
UnmarshalText([]byte) error
to parse the notation
Additionally, each package provides these two functions:
Parse(string) (Type, error)
parses the given string, and validates itIsValid(string) bool
simply checks whether the given string is valid in the given standard.
Built with β€ by Maximilian von Lindern. Available under the MIT License.