def _long_hash(istream):
    """
    Produces a hash-like value which is longer than the usual hash value.
    As currently implemented, returns a 4-tuple of regular width hashes.
    These are used internally to have an acceptably low chance of collisions.
    It does not make any promise of cryptographic security,
    only protection against failure in regular use.
    """
    state = [0]*6
    key = 0
    def _mix(state, value, key):
        """
        Internal mixing function.
        Absorbs a new value, then does a mixing round.
        Designed to be inexpensive but provide sufficient mixing.
        """
        state[0] ^= hash(value)
        for n in range(5):
            state[n+1] ^= hash((state[n], key, n))
        state[0] ^= hash((state[5], key, 5))
    # absorb all values
    for value in istream:
        _mix(state, value, key)
        key += 1
    # pad/finalize
    _mix(state, 0, -2)
    # truncate result
    return tuple(state)[0:4]