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.