Skip to content
Converts radix-10 numbers to their radix-64 numerical equivalent and back
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
lib
src
.editorconfig
.gitignore
.prettierrc
LICENSE.md
jest.config.js
package-lock.json
package.json
readme.md
tsconfig.json
tslint.json

readme.md

Radix 10 to radix 64

Converts radix-10 numbers to their radix-64 numerical equivalent and back. Inspired by this Stack Overflow question.

This module is originally written in Typescript and provides native type definitions.

Usage

ES Modules environment:

import Radix10ToRadix64 from 'radix10toradix64';

const converter = new Radix10ToRadix64();
// To radix 64
converter.toRadix64(4096); // '100'
converter.toRadix64(62831853071); // 'wX4VuF'
// From radix 64
converter.toRadix10('4096'); // 1049158
converter.toRadix10('628318530'); // 1698198949220544

CommonJS:

const Radix10ToRadix64 = require('radix10toradix64').default;
const converter = new Radix10ToRadix64();
// To radix 64
converter.toRadix64(4096); // '100'
converter.toRadix64(62831853071); // 'wX4VuF'
// From radix 64
converter.toRadix10('4096'); // 1049158
converter.toRadix10('628318530'); // 1698198949220544

Development

  • Clone repo
  • npm i
  • Code
  • npm test
  • npm build

Contributing

The initial goal of this module is to provide basic radix 10 to radix 64 conversion for a side project of mine. Whilst I have no intentions of making this a complex library and add lots of functionality myself, you're welcome to submit PRs with new features.

If you found a bug, please open an issue and I'll do my best to get it sorted asap. If you can submit a PR with the bugfix that is even better!

License

MIT, see LICENSE.md.

Copyright (c) 2018 Leonardo Melo.

You can’t perform that action at this time.