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() stringto get the notation pretty-printedCompact() stringto get the notation in compact, machine-readable formMarshalText() ([]byte, error)same asCompactUnmarshalText([]byte) errorto parse the notation
Additionally, each package provides these two functions:
Parse(string) (Type, error)parses the given string, and validates itIsValid(string) boolsimply checks whether the given string is valid in the given standard.
Built with ❤ by Maximilian von Lindern. Available under the MIT License.