I'm playing around with a minifier where I have a very large base of symbols. I'm looking for a function / library that allows me to do something like:
const a = '123456789876543212345678987654321' // Some huge number
const b = convertBase(a, 10, 16) // (Number, Base: From, Base: To)
// [6,1,6,3,14,6,7,1,2,14,11,11,10,10,4,14,3,13,6,2,11,4,1,15,4,11,1]
In practice, I'd like to convert something like a 255 character hex value to something like, base-1024. Converting from hex to decimal with an arbitrary level of precision is relatively straight forward, but looking around on stackoverflow / npm / github, I'm not seeing a simple example that avoids the use of custom alphabets when working with very large numbers / very large bases.
Is there a better name for this than an "arbitrary precision base conversion represented by an array of decimals"? Where might I find a decent implementation of this function in modern javascript / ECMAScript?