Add hashlib support for hashing of pools
authorClifford Wolf <clifford@clifford.at>
Tue, 22 Aug 2017 11:04:33 +0000 (13:04 +0200)
committerClifford Wolf <clifford@clifford.at>
Tue, 22 Aug 2017 11:04:33 +0000 (13:04 +0200)
kernel/hashlib.h

index 63ac956f21d8ff78bf1168c9377ff8ba585ab149..df534ec1bbde3229f33e3ee0c3fa47feec68817f 100644 (file)
@@ -868,6 +868,13 @@ public:
                return !operator==(other);
        }
 
+       bool hash() const {
+               unsigned int hashval = mkhash_init;
+               for (auto &it : entries)
+                       hashval ^= ops.hash(it.udata);
+               return hashval;
+       }
+
        void reserve(size_t n) { entries.reserve(n); }
        size_t size() const { return entries.size(); }
        bool empty() const { return entries.empty(); }