diff --git a/AK/HashMap.h b/AK/HashMap.h index f707c660681..4d4cdc516a9 100644 --- a/AK/HashMap.h +++ b/AK/HashMap.h @@ -165,6 +165,16 @@ public: return list; } + [[nodiscard]] u32 hash() const + { + u32 hash = 0; + for (auto& it : *this) { + auto entry_hash = pair_int_hash(it.key.hash(), it.value.hash()); + hash = pair_int_hash(hash, entry_hash); + } + return hash; + } + private: HashTableType m_table; };