oib.js
v1.0.3
Published
OIB validator
Downloads
175
Maintainers
Readme
OIB.js - Simple OIB validation
What is OIB?
OIB is Osobni identifikacijski broj (eng. Personal identification number); a uniq numerical identificator of companies and people in Republic of Croatia. It's in use since 2009.
Usage
Install it with npm:
npm install --save oib.js
And use it like:
const oib = require('oib.js');
oib.validate('24076340234');
Or include it in your HTML (1995 style):
<script src="https://unpkg.com/oib.js"></script>
And use it like:
oib.validate('24076340234');
Methods
validate(1)
This will validate against the full specification of the standard. It accepts both string
and number
. It returns true
or false
.
oib.validate('24076340234');
oib.validate(24076340234);
iso7064(1)
This validates only against ISO 7064 standard (it just exposes the ISO 7064 algorithm). It accepts both string
and number
. It returns true
or false
.
oib.iso7064('24076340234');
oib.iso7064(24076340234);
License
Andrei Zvonimir Crnkovic [email protected] MIT 2016.