change string->int function to support hex str