def convert_to_base_unit(value, unit):
    """
    Convert value from current unit to base unit
    :param (int) value: Numerical value
    :param (str) unit: unit, where empty string denotes base unit
    :return: (int) the value in base unit
    """
    POWERS_BY_UNIT = {'n': -3,
                        'u': -2,
                        'm': -1,
                        '': 0,
                        'K': 1, 'Ki': 1,
                        'M': 2, 'Mi': 2,
                        'G': 3, 'Gi': 3,
                        'T': 4, 'Ti': 4,
                        'P': 5, 'Pi': 5,
                        'E': 6, 'Ei': 6}

    if unit in ['n','u','m','','K','M','G','T','P','E']: # normal si system prefixes
        base = 1000
    else: # iec system
        base = 1024
    return value * (base ** POWERS_BY_UNIT[unit])