Basea
Convert between numerical bases.
Install
npm install basea
Usage
const basea = ; ; // Convert 20 to base 16//=> '14' ; // Convert 20 to base 10 from base 16//=> '20' ; // 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"
.