iso-7064
v1.1.0
Published
Implementation of ISO 7064 used in validation of format like IBAN, LEI, ...
Downloads
26,546
Maintainers
Readme
ISO-7064
Implementation of ISO 7064 used in validation of format like IBAN, LEI, ..
Installation
Install using npm:
$ npm install iso-7064
Usage
var iso7064 = require('iso-7064');
iso7064.compute('969500KSV493XWY0PS'); // 54
iso7064.computeWithoutCheck('7245005WBNJAFHBD0S'); // 55
API
compute(rawValue: String)
-> Number
Check requirements.
Returns result of modulo 97 applied to the String input rawValue.
Required
- rawValue must be not
Null
- rawValue must be of type
String
- rawValue must respect format
^[0-9A-Z]{1,}$
computeWithtoutCheck(rawValue: String)
-> Number
Does NOT check requirements.
Returns result of modulo 97 applied to the String input rawValue.
Note: Use this method for faster performance if you already did the requirements checks in your code.
Required
- rawValue must be not
Null
- rawValue must be of type
String
- rawValue must respect format
^[0-9A-Z]{1,}$