hash-unordered-coll
(hash-unordered-coll coll)
Source docstring:
Returns the hash code, consistent with =, for an external unordered
collection implementing Iterable. For maps, the iterator should
return map entries whose hash is computed as
(hash-ordered-coll [k v]).
See http://clojure.org/data_structures#hash for full algorithms.
(defn ^number hash-unordered-coll
[coll]
(loop [n 0 hash-code 0 coll (seq coll)]
(if-not (nil? coll)
(recur (inc n) (bit-or (+ hash-code (hash (first coll))) 0) (next coll))
(mix-collection-hash hash-code n))))