GithubHelp home page GithubHelp logo

mavolin / standards Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 178 KB

๐Ÿ“„ 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: MIT License

Go 99.31% Shell 0.01% Nix 0.68%
bic go golang iban iso3166 iso3166-1 ssn tax-id validation german

standards's Introduction

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.

standards's People

Contributors

mavolin avatar

Stargazers

 avatar

Watchers

 avatar

standards's Issues

fix(iban): Incorrect national check sum validations for Finland and Estonia.

Describe the bug
Valid IBANs from Finland and Estonia are considered invalid due to national checksum validation.
Here are two random valid IBANs "EE321282973364859699", "FI9775844768617584".

Expected behavior
Valid IBANs are considered valid.

Error Messages
If applicable provide error messages and stack traces.

Versions
v0.4.0

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.