Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

andreicek/oib.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OIB.js - Simple OIB validation

Build Status

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.