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
- Host: GitHub
- URL: https://github.com/caub/baseconv
- Owner: caub
- Created: 2018-05-07T17:44:24.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-08-07T20:53:30.000Z (almost 6 years ago)
- Last Synced: 2025-10-10T06:21:13.930Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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