itemWiseHashCode

fun <T> itemWiseHashCode(vararg items: T): Int

Computes a hash code out of the given items, consistent with itemWiseEquals: two iterables that are itemWiseEquals (under ==) always produce the same itemWiseHashCode, much like List.hashCode does for lists, but usable on any Iterable/Sequence. Handy when implementing Any.hashCode for a custom collection-like type that should be compared item-wise (e.g. structurally-shared term lists) rather than by reference.


fun <T> itemWiseHashCode(iterable: Iterable<T>): Int

Same as itemWiseHashCode, taking the items as an Iterable.


fun <T> itemWiseHashCode(sequence: Sequence<T>): Int

Same as itemWiseHashCode, taking the items as a Sequence.