(defn
hash
"Returns the hash code of its argument. Note this is the hash code\n consistent with =."
[o]
(cond
(implements? IHash o)
(bit-xor (-hash o) 0)
(number? o)
(if
(js/isFinite o)
(js-mod (Math/floor o) 2147483647)
(case o ##Inf 2146435072 ##-Inf -1048576 2146959360))
(true? o)
1231
(false? o)
1237
(string? o)
(m3-hash-int (hash-string o))
(instance? js/Date o)
(bit-xor (.valueOf o) 0)
(nil? o)
0
:else
(bit-xor (-hash o) 0)))