Added digitsBase function.
Fixed wrong recursive call in digitsBase.
Simplified 36 with digitsBase.