function | since v0.0-2261 | clojure.core/hash-ordered-coll | Edit |
(hash-ordered-coll coll)
Returns the hash code, consistent with =, for an external ordered collection implementing Iterable. See http://clojure.org/data_structures#hash for full algorithms.
(defn ^number hash-ordered-coll
[coll]
(loop [n 0 hash-code 1 coll (seq coll)]
(if-not (nil? coll)
(recur (inc n) (bit-or (+ (imul 31 hash-code) (hash (first coll))) 0)
(next coll))
(mix-collection-hash hash-code n))))