iso-11649

Creditor Reference validation and conversion following ISO 11649

Usage no npm install needed!

<script type="module">
  import iso11649 from 'https://cdn.skypack.dev/iso-11649';
</script>

README

npm version Build Status GitHub license

iso-11649

European Structured Communication validation and conversion following ISO 11649.

Installation

Install using npm:

$ npm install iso-11649

Usage

In node.js

var ISO11649 = require('iso-11649');

ISO11649.generate('TU06FX'); // RF96TU06FX
ISO11649.generate('X2HU4TC28XTYLHASYWT91'); // RF14X2HU4TC28XTYLHASYWT91

ISO11649.validate('RF720HYA6'); // true
ISO11649.validate('RF19GAX8WS5JYOOUJ87'); // false

API

generate(rawValue: String) -> String

Check requirements.
Returns value as a valid Creditor Reference using rawValue.

Required

  • rawValue must be not Null
  • rawValue must be of type String
  • rawValue must respect format ^[A-Z0-9]{1,21}$

validate(rawValue: String) -> Boolean

Check requirements.
Returns if the Creditor Reference format against ISO 11649 specifications is valid.

Required

  • rawValue must be not Null
  • rawValue must be of type String
  • rawValue must respect format ^RF[0-9]{2}[A-Z0-9]{1,21}$