Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bchainhub/go-ican

Golang ICAN Addresses validation
https://github.com/bchainhub/go-ican

bcan core-blockchain ican

Last synced: about 11 hours ago
JSON representation

Golang ICAN Addresses validation

Awesome Lists containing this project

README

        

## Go-ICAN

### Basic Golang ICAN validator

Validations:
- Validate if country/crypto code and check digits are present
- Validate if country/crypto code is in accepted country code list
- Validate national BCAN code format
- Validate mod97 check digits

#### Testing
Test suite includes example of ICAN's for most countries and fake ICAN's. Errors are as specific as possible.

#### Example

package main

import (
"fmt"
"github.com/cryptohub-digital/go-ican"
)

func main() {
ican, err := ican.NewICAN("NL40ABNA0517552264")

if err != nil {
fmt.Printf("%v\n", err)
} else {
fmt.Printf("%v\n", ican.PrintCode)
fmt.Printf("%v\n", ican.Code)
}
}

## License

[CORE License](LICENSE)