base-conversion-from-dec
Auto-curried converter to any base with arbitrary precision support and customisable symbols.
For the opposite behaviour, see base-conversion-to-dec. For any to any base conversions, see base-conversion.
Install
npm i base-conversion-from-dec
Basic usage
var bc = ;var toBin = ; ; //=> '1010'; //=> '11110'
See spec.
Custom symbols
For any bases above 62, custom symbols are required. See tests for working examples.
var bc = ; bc; //=> '⑥①'
Arbitrary precision
var bc = ;var Big = ;var toBigFactory = ; var d = ; // avoid large numbers to go into exponential notation (adapter dependent)BigImplE_POS = 50; bc;//=> '802531310452364303450750087576673257456135727727'
Full raw version
var bc = ;var Big = ;var toBigFactory = ; var d = ; // avoid large numbers to go into exponential notation (adapter dependent)BigImplE_POS = 50; bc;//=> '802#313104#23643034#07#0087#766732#74#613#727727'
Defaults
The default symbols and big implementation are exposed as follows:
bcdefaultSymbols; //=> '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'bcdefaultB; //=> default arbitrary precision implementation (div & mod)