Code Monkey home page Code Monkey logo

ican.js's Introduction

ican.js

ICAN and BCAN validation, formatting, and conversion in JavaScript.

ICAN.js adheres to the ISO 13616 IBAN Registry technical specification and includes support for Crypto addresses.

Usage

ICAN.js is compatible with both CommonJS and AMD module definitions.

NPM

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

Yarn

yarn add @blockchainhub/ican

NPM

npm i @blockchainhub/ican

In node.js

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

In the browser

You can use a module loader (AMD or CommonJS) or access it 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

Using ICAN.js with React is easy. For example:

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

API

  • isValid(ican, onlyCrypto)
  • toBCAN(ican, separator, onlyCrypto)
  • fromBCAN(countryCode, bcan)
  • isValidBCAN(countryCode, bcan, onlyCrypto)
  • printFormat(ican, separator)
  • electronicFormat(ican)
  • shortFormat(ican, separator, frontCount, backCount)

Contributions

We welcome contributions in any form. Here's how you can help:

Epigram

「Cryptoni Confidimus」

License

Licensed under the CORE License.

ican.js's People

Contributors

laurentvb avatar rastislavcore avatar itoche avatar lukaszklis avatar benhc123 avatar drewtron avatar icnagy avatar cyrilschumacher avatar davidmsync avatar johannespfeiffer avatar msalcala11 avatar paulromerolegal avatar stymaar avatar

Watchers

 avatar James Cloos avatar ali avatar Sasha Zezulinsky avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.