`toBase` and `fromBase` should be refactored to simply serve as proxies for this function.