def byteConversion(amount, btype):
    """ convert unit of memory size into bytes for comparing different
        unit measures

    :param amount: unit of memory size
    :ptype amount: float
    :param btype: unit type
    :ptype btype: string
    :return: unit in bytes
    :rtype: float
    """
    n = 1
    conversionMap = {"KB": 1, "TB": 4, "GB": 3, "MB": 2}
    _bytes = amount
    if btype.upper() in conversionMap:
        n = conversionMap[btype.upper()]
    for _ in range(n):
        _bytes *= 1024
    return _bytes