generateHashCode static method

int generateHashCode(
  1. Iterable<Object?> objects
)

Generates a hash code for a collection of objects, recursively handling nested iterables.

Returns: A 32-bit integer hash code.

Implementation

static int generateHashCode(Iterable<Object?> objects) {
  int hash = 12;
  for (final element in objects) {
    if (element is Iterable) {
      hash = (hash ^ generateHashCode(element)) & mask32;
    } else {
      hash = (hash ^ element.hashCode) & mask32;
    }
  }
  return hash;
}