protected static function fromBase10(
        /*# string */ $input,
        /*# string */ $toBase
    )/*# string */ {
        $len = strlen($toBase);
        $res = '';
        do {
            $digit = bcmod($input, $len);
            $res = $toBase[(int) $digit] . $res;
            $input = bcdiv($input, $len, 0);
        } while ($input != '0');
        return $res;
    }