Skip to content

๐Ÿ“„ Boringly simple parsing and validation for IBANs, BICs, ISO3166 alpha-2s, German Health Insurance Numbers, German Tax IDs, German Pension Insurance Numbers, and German Postal Codes.

License

Notifications You must be signed in to change notification settings

mavolin/standards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

33 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

standards

Go Reference Test Code Coverage Go Report Card License MIT


About

Boringly simple parsing and validation for various notations.

Supported Standards

  • ๐Ÿฆ BICs
  • ๐Ÿ’ฐ IBANs with country-specific BBAN validation
  • ๐Ÿดโ€โ˜ ๏ธ ISO3166-1 Alpha2 (e.g. DE, or ES)
  • ๐Ÿš‘ German Health Insurance Numbers (Krankenversicherungsnummern)
  • ๐Ÿง“ German Pension Insurance Numbers (Renten-/ Sozialversicherungsnummern)
  • ๐Ÿ’ฒ German Tax Identification Numbers (Steuer-IDs)
  • โœ‰ German Postal Codes (Postleitzahlen)

Each Package Is the Same

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-printed
  • Compact() string to get the notation in compact, machine-readable form
  • MarshalText() ([]byte, error) same as Compact
  • UnmarshalText([]byte) error to parse the notation

Additionally, each package provides these two functions:

  • Parse(string) (Type, error) parses the given string, and validates it
  • IsValid(string) bool simply checks whether the given string is valid in the given standard.

License

Built with โค by Maximilian von Lindern. Available under the MIT License.

About

๐Ÿ“„ Boringly simple parsing and validation for IBANs, BICs, ISO3166 alpha-2s, German Health Insurance Numbers, German Tax IDs, German Pension Insurance Numbers, and German Postal Codes.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages