def _update_hasher(hasher, data, types=True):
<EOL>if isinstance(data, (tuple, list, zip)):<EOL><INDENT>needs_iteration = True<EOL><DEDENT>else:<EOL><INDENT>needs_iteration = any(check(data) for check in<EOL>_HASHABLE_EXTENSIONS.iterable_checks)<EOL><DEDENT>if needs_iteration:<EOL><INDENT>SEP = b'<STR_LIT>'<EOL>ITER_PREFIX = b'<STR_LIT>'<EOL>ITER_SUFFIX = b'<STR_LIT>'<EOL>iter_ = iter(data)<EOL>hasher.update(ITER_PREFIX)<EOL>try:<EOL><INDENT>for item in iter_:<EOL><INDENT>prefix, hashable = _convert_to_hashable(item, types)<EOL>binary_data = prefix + hashable + SEP<EOL>hasher.update(binary_data)<EOL><DEDENT><DEDENT>except TypeError:<EOL><INDENT>_update_hasher(hasher, item, types)<EOL>for item in iter_:<EOL><INDENT>_update_hasher(hasher, item, types)<EOL>hasher.update(SEP)<EOL><DEDENT><DEDENT>hasher.update(ITER_SUFFIX)<EOL><DEDENT>else:<EOL><INDENT>prefix, hashable = _convert_to_hashable(data, types)<EOL>binary_data = prefix + hashable<EOL>hasher.update(binary_data)<EOL><DEDENT>
Converts `data` into a byte representation and calls update on the hasher
`hashlib.HASH` algorithm.

Args:
    hasher (HASH): instance of a hashlib algorithm
    data (object): ordered data with structure
    types (bool): include type prefixes in the hash

Example:
    >>> hasher = hashlib.sha512()
    >>> data = [1, 2, ['a', 2, 'c']]
    >>> _update_hasher(hasher, data)
    >>> print(hasher.hexdigest()[0:8])
    e2c67675

    2ba8d82b