docs-code
It is validator about official of documents codes in Go
Alert
It is not production ready public API! It is API could be change it the future. To be attentive for this.
Status
Status of implementation by code package:
- OKATO
- Generate method
- Validate method
- SNILS
- Generate method
- Validate method
Full supported codes: BIK, INN, KPP, OGRN, OGRNIP
Usage
go get github.com/sshaplygin/docs-code
Example
import (
"log"
"github.com/sshaplygin/docs-code"
)
...
isValid, err := docs_code.Validate(docs_code.INN, "526317984689")
if err != nil {
log.Error(err)
}
if !isValid {
log.Println("INN is invalid")
} else {
log.Println("INN is valid")
}
Documentation
- Info about INN - ИНН
- Info about SNILS - СНИЛС
- Info about OGRN - ОГРН
- Info about OGRNIP - ОГРНИП
- Info about BIK - БИК
- Info about KPP - КПП