iso-7064
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

npm version Build Status Codacy Badge codecov GitHub issues GitHub license

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,}$

Package Sidebar

Install

npm i iso-7064

Weekly Downloads

2,831

Version

1.1.0

License

MIT

Unpacked Size

8.48 kB

Total Files

10

Last publish

Collaborators

  • edumdum