Add hexToDecimal function.