IoT Inspector interview question

Write a digit parser with error tolerance supporting different bases.