0.0.1 • Published 7 years ago

radix.js v0.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

Radix.js

Radix.js is a simple javascript module to convent number to 2~64 radix, decimal supported.

Build Status Coverage Status npm npm npm

1. Install

npm install radix.js

Or download dist/radix.min.js source file。

2. Import It

  • Script tag.
<script type="text/javascript" src="dist/radix.min.js"></script>
  • ES6 style.
var Radix = require('radix.js');

//or

import Radix from 'radix.js';

3. Usage & API

There is only one API named convent.

var radix = new Radix();
radix.convent(5201314, 10, 64); // will convent number 5301314 from radix 10 to radix 64.

Now the max radix is 64, and the formatter is: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_@. Also you can set your own formatter like below:

var radix = new Radix('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz');
radix.convent('jRSy', 64);

4. Test

npm install

npm test

5. LICENSE

MIT@hustcc