def get_int_value(message, base):
    """ Converts a field from a str message to a number
    
    From a string of the form "varname=val" returns only the value in hex
    
    Parameters
    ----------
    message: str
    base: str, hex or dec
    
    Returns
    -------
    val: int (hexadecimal)
    """
    
    num = message[message.find("=")+1:]
    if base == 'hex':
        val = int(num, 16)
    else:
        val = int(num,10)
    return val