mapHash<K, V> function

int mapHash<K, V>(
  1. Map<K, V>? map
)

A deep hash of a nullable map — consistent with mapsEqual. Two maps that compare equal under mapsEqual produce the same hash. Null hashes to 0.

Implementation

int mapHash<K, V>(Map<K, V>? map) {
  if (map == null) return 0;
  return const DeepCollectionEquality().hash(map);
}