def combine_uuids(uuids, ordered=True, salt=''):
    """
    Creates a uuid that specifies a group of UUIDS

    Args:
        uuids (list): list of uuid objects
        ordered (bool): if False uuid order changes the resulting combined uuid
            otherwise the uuids are considered an orderless set
        salt (str): salts the resulting hash

    Returns:
        uuid.UUID: combined uuid

    CommandLine:
        python -m utool.util_hash --test-combine_uuids

    Example:
        >>> # ENABLE_DOCTEST
        >>> from utool.util_hash import *  # NOQA
        >>> import utool as ut
        >>> uuids = [hashable_to_uuid('one'), hashable_to_uuid('two'),
        >>>          hashable_to_uuid('three')]
        >>> combo1 = combine_uuids(uuids, ordered=True)
        >>> combo2 = combine_uuids(uuids[::-1], ordered=True)
        >>> combo3 = combine_uuids(uuids, ordered=False)
        >>> combo4 = combine_uuids(uuids[::-1], ordered=False)
        >>> result = ut.repr4([combo1, combo2, combo3, combo4], nobr=True)
        >>> print(result)
        UUID('83ee781f-8646-ccba-0ed8-13842825c12a'),
        UUID('52bbb33f-612e-2ab8-a62c-2f46e5b1edc8'),
        UUID('945cadab-e834-e581-0f74-62f106d20d81'),
        UUID('945cadab-e834-e581-0f74-62f106d20d81'),

    Example:
        >>> # ENABLE_DOCTEST
        >>> from utool.util_hash import *  # NOQA
        >>> import utool as ut
        >>> uuids = [uuid.UUID('5ff6b34e-7d8f-ef32-5fad-489266acd2ae'),
        >>>          uuid.UUID('f2400146-ec12-950b-1489-668228e155a8'),
        >>>          uuid.UUID('037d6f31-8c73-f961-1fe4-d616442a1e86'),
        >>>          uuid.UUID('ca45d6e2-e648-09cc-a49e-e71c6fa3b3f3')]
        >>> ordered = True
        >>> salt = u''
        >>> result = combine_uuids(uuids, ordered, salt)
        >>> print(result)
        1dabc66b-b564-676a-99b4-5cae7a9e7294
    """
    if len(uuids) == 0:
        return get_zero_uuid()
    elif len(uuids) == 1:
        return uuids[0]
    else:
        if not ordered:
            uuids = sorted(uuids)
        sep_str = '-'
        sep_byte = six.binary_type(six.b(sep_str))
        pref = six.binary_type(six.b('{}{}{}'.format(salt, sep_str, len(uuids))))
        combined_bytes = pref + sep_byte.join([u.bytes for u in uuids])
        combined_uuid = hashable_to_uuid(combined_bytes)
        return combined_uuid
def combine_uuids ( uuids , ordered = True , salt = '' ) : if len ( uuids ) == 0 : return get_zero_uuid ( ) elif len ( uuids ) == 1 : return uuids [ 0 ] else : if not ordered : uuids = sorted ( uuids ) sep_str = '-' sep_byte = six . binary_type ( six . b ( sep_str ) ) pref = six . binary_type ( six . b ( '{}{}{}' . format ( salt , sep_str , len ( uuids ) ) ) ) combined_bytes = pref + sep_byte . join ( [ u . bytes for u in uuids ] ) combined_uuid = hashable_to_uuid ( combined_bytes ) return combined_uuid
Creates a uuid that specifies a group of UUIDS

    Args:
        uuids (list): list of uuid objects
        ordered (bool): if False uuid order changes the resulting combined uuid
            otherwise the uuids are considered an orderless set
        salt (str): salts the resulting hash

    Returns:
        uuid.UUID: combined uuid

    CommandLine:
        python -m utool.util_hash --test-combine_uuids

    Example:
        >>> # ENABLE_DOCTEST
        >>> from utool.util_hash import *  # NOQA
        >>> import utool as ut
        >>> uuids = [hashable_to_uuid('one'), hashable_to_uuid('two'),
        >>>          hashable_to_uuid('three')]
        >>> combo1 = combine_uuids(uuids, ordered=True)
        >>> combo2 = combine_uuids(uuids[::-1], ordered=True)
        >>> combo3 = combine_uuids(uuids, ordered=False)
        >>> combo4 = combine_uuids(uuids[::-1], ordered=False)
        >>> result = ut.repr4([combo1, combo2, combo3, combo4], nobr=True)
        >>> print(result)
        UUID('83ee781f-8646-ccba-0ed8-13842825c12a'),
        UUID('52bbb33f-612e-2ab8-a62c-2f46e5b1edc8'),
        UUID('945cadab-e834-e581-0f74-62f106d20d81'),
        UUID('945cadab-e834-e581-0f74-62f106d20d81'),

    Example:
        >>> # ENABLE_DOCTEST
        >>> from utool.util_hash import *  # NOQA
        >>> import utool as ut
        >>> uuids = [uuid.UUID('5ff6b34e-7d8f-ef32-5fad-489266acd2ae'),
        >>>          uuid.UUID('f2400146-ec12-950b-1489-668228e155a8'),
        >>>          uuid.UUID('037d6f31-8c73-f961-1fe4-d616442a1e86'),
        >>>          uuid.UUID('ca45d6e2-e648-09cc-a49e-e71c6fa3b3f3')]
        >>> ordered = True
        >>> salt = u''
        >>> result = combine_uuids(uuids, ordered, salt)
        >>> print(result)
        1dabc66b-b564-676a-99b4-5cae7a9e7294