0.2.0 • Published 2 years ago

@cryptohub/ican v0.2.0

Weekly downloads
14
License
CORE
Repository
github
Last release
2 years ago

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.