protected static function toBase10(
        /*# string */ $input,
        /*# string */ $fromBase
    )/*# string */ {
        $len = strlen($fromBase);
        $res = '0';
        foreach (str_split($input) as $char) {
            $res = bcadd((int) strpos($fromBase, $char), bcmul($res, $len));
        }
        return $res;
    }