Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/petarov/bulgarian-control-numbers
Библиотека за проверка на контролни цифри (ЕГН, ЛНЧ, Булстат, IBAN)
https://github.com/petarov/bulgarian-control-numbers
bulgaria bulgarian bulstat egn iban iban-validator vat
Last synced: 19 days ago
JSON representation
Библиотека за проверка на контролни цифри (ЕГН, ЛНЧ, Булстат, IBAN)
- Host: GitHub
- URL: https://github.com/petarov/bulgarian-control-numbers
- Owner: petarov
- License: mit
- Created: 2020-04-05T19:58:51.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-10T09:49:00.000Z (7 months ago)
- Last Synced: 2024-04-14T05:56:47.676Z (7 months ago)
- Topics: bulgaria, bulgarian, bulstat, egn, iban, iban-validator, vat
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/bulgarian-control-numbers
- Size: 2.88 MB
- Stars: 5
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Bulgarian Control Numbers
==========================[![CircleCI](https://circleci.com/gh/petarov/bulgarian-control-numbers.svg?style=svg)](https://circleci.com/gh/petarov/bulgarian-control-numbers) [![npm version][npm-image]][npm-url]
[npm-url]: https://www.npmjs.com/package/bulgarian-control-numbers
[npm-image]: https://img.shields.io/npm/v/bulgarian-control-numbers.svg:bulgaria: Проверка на контролни цифри ползвани в България - ЕГН, ЛНЧ, Булстат, IBAN.
# Install
npm install bulgarian-control-numbers
or
yarn add bulgarian-control-numbers
or
```html
```
# Usage
As a node.js module:
```javascript
const BGCN = require('bulgarian-control-numbers').default;const egn = BGCN.egn('0550290476');
egn.isValid // true
egn.value // '0550290476'
egn.gender // 'f'
egn.birthday.day // 29
egn.birthday.month // 10
egn.birthday.year // 2005const pn = BGCN.pn('1001122334'); // ЛНЧ
pn.isValid // trueconst bulstat = BGCN.bulstat('BG131071587')
bulstat.isValid// true
bulstat.value // '131071587'const iban = BGCN.iban('BG15UNCR70001522604629');
iban.isValid// true
iban.value // 'BG15UNCR70001522604629'
iban.accountNo // '22604629'
iban.bic // 'UNCRBGSF'BGCN.isValid('BG131071587') // true
BGCN.isValid('BG15UNCR70001522604629') // true
```In a web page:
```html
var BGCN = BGCN.default;
var egn = BGCN.egn('0550290476');
// ...```
# Development
Run `yarn install` to install dependencies.
Run `yarn test` to run unit tests.
Run `yarn build` to create a build.
# References
* [БСВ Консултинг - Контролни цифри ползвани в България](http://bsv-bg.com/контролни-цифри-ползвани-в-българия)
* [Единен граждански номер](https://bg.wikipedia.org/wiki/Единен_граждански_номер)
* [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number)# License
[MIT](LICENSE)