def human_readable_bytes(value: int, digits: int=2, delim: str='', postfix:
    str='') ->str:
    """
    Return a human-readable bytes value as a string.

    Parameters:
        value: the bytes value.
        digits: how many decimal digits to use.
        delim: string to add between value and unit.
        postfix: string to add at the end.

    Returns:
        The human-readable version of the bytes.
    """
    chosen_unit = 'B'
    for unit in ('KiB', 'MiB', 'GiB', 'TiB'):
        if value > 1000:
            value /= 1024
            chosen_unit = unit
        else:
            break
    return f'{value:.{digits}f}' + delim + chosen_unit + postfix
