def argToInt(value):
    """ Given a size or addresse of the type passed in args	(ie 512KB or 1MB) then return the value in bytes.
    In case of neither KB or MB was specified, 0x prefix can be used.
    """
    for letter, multiplier in [("k", 1024), ("m", 1024 * 1024), ("kb", 1024), ("mb", 1024 * 1024), ]:
        if value.lower().endswith(letter):
            return int(value[:-len(letter)], 0) * multiplier
    else:
        return int(value, 0)