@cryptohub/ican
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

ican.js

ICAN and BCAN validation, formatting and conversion in Javascript.

ICAN.js follows the ISO 13616 IBAN Registry technical specification with the addition of the Crypto addresses.

Usage

ICAN.js is compatible with both commonjs and AMD module definition.

NPM

You can install @cryptohub/ican from NPM using Yarn, NPM or another tool.

Yarn

yarn add @cryptohub/ican

NPM

npm i @cryptohub/ican

In node.js

var ICAN = require('@cryptohub/ican');
ICAN.isValid('hello world'); // false
ICAN.isValid('BE68539007547034'); // true

In the browser

Using a module loader (AMD or commonjs) or directly through the global ICAN object:

<script src="ican.js"></script>
<script>
    // the API is now accessible from the window.ICAN global object
    ICAN.isValid('hello world'); // false
    ICAN.isValid('BE68539007547034'); // true
</script>

With React

Use in the react is easy. For example:

import Ican from '@cryptohub/ican';
Ican.isValid('hello world');
Ican.isValid('BE68539007547034');

API

* isValid(ican)
* toBCAN(ican, separator)
* fromBCAN(countryCode, bcan)
* isValidBCAN(countryCode, bcan)
* printFormat(ican, separator)
* electronicFormat(ican)

Contributions

Feel free to contribute in any way.

We appreciate:

Epigram

「Cryptoni Confidimus」

License

Licensed under the CORE License.

Package Sidebar

Install

npm i @cryptohub/ican

Weekly Downloads

91

Version

0.2.0

License

CORE

Unpacked Size

26.7 kB

Total Files

5

Last publish

Collaborators

  • coreorg