An open API service indexing awesome lists of open source software.

https://github.com/caub/baseconv

:key: Convert arbitrarily big numbers between bases
https://github.com/caub/baseconv

Last synced: about 2 months ago
JSON representation

:key: Convert arbitrarily big numbers between bases

Awesome Lists containing this project

README

          

# radix conversion

[![npm version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![coverage status][codecov-image]][codecov-url]

- default alphabet is `'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'` for input and output
- you can change it by passing different alphabets to the `BaseConv` exported function
- no IEEE-754 limitation

usage:
```js
const conv = require('base-conv').default;
conv(42, 10, 16) // '2a'
conv('42', 10, 16) // '2a'
conv('42'.repeat(100), 10, 16) // '8de2991df40ff783057818d0012f3bc1c...'
```

[npm-image]: https://img.shields.io/npm/v/base-conv.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/base-conv
[travis-image]: https://img.shields.io/travis/caub/base-conv.svg?style=flat-square
[travis-url]: https://travis-ci.org/caub/base-conv
[codecov-image]: https://img.shields.io/codecov/c/github/caub/base-conv.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/caub/base-conv