@cryptohub/ican
v0.2.0
Published
A javascript library to validate, format and convert ICAN (International Crypto Account Number) and BCAN (Basic Crypto Account Number)
Downloads
92
Maintainers
Readme
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:
- Fork this repository
- Open pull request
- Send us some Øres / ₡ores: cb7147879011ea207df5b35a24ca6f0859dcfb145999
- Star this repository
Epigram
「Cryptoni Confidimus」
License
Licensed under the CORE License.