Skip to content

Richienb/basea

Repository files navigation

Basea Travis CI Build Status

Convert between numerical bases.

NPM Badge

Install

npm install basea

Usage

const basea = require("basea");

basea(20, 16); // Convert 20 to base 16
//=> '14'

basea("14", 16, 10); // Convert 20 to base 10 from base 16
//=> '20'

basea(10, "abc"); // Convert 10 to use a custom base
//=> 'bab'

API

basea(number, from, to)

basea(number, to)

basea(stringNumber, from)

number

Type: number or string

The number to convert.

from

Type: number or string

The base to convert from.

to

Type: number or string

The base to convert to.

basea.bases

Type: object

Numerical bases to use for conversion. Can be modified to affect the output of basea, such as basea.bases[999] = "abc".

About

Convert between numerical bases.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published