Convert the base of bignums in javascript