EnumerableUtility.SequenceHashCode<T> method (1 of 2)

Gets the hash code for a sequence.

public static int SequenceHashCode<T>(this IEnumerable<T>? source)
parameter description
T The type of the elements.
source The sequence.

Return Value

A valid hash code for the sequence, assuming Enumerable.SequenceEqual is used to compare them.

Remarks

If the sequence is null, zero is returned.

See Also


EnumerableUtility.SequenceHashCode<T> method (2 of 2)

Gets the hash code for a sequence.

public static int SequenceHashCode<T>(this IEnumerable<T>? source, IEqualityComparer<T>? comparer)
parameter description
T The type of the elements.
source The sequence.
comparer The comparer.

Return Value

A valid hash code for the sequence, assuming Enumerable.SequenceEqual is used to compare them.

Remarks

If the sequence is null, zero is returned.

See Also