       h
       (add-to-string-hash-cache k))))
 
-(defn hash
-  ([o] (hash o true))
-  ([o ^boolean check-cache]
-     (if (and ^boolean (goog/isString o) check-cache)
-       (check-string-hash-cache o)
-       (-hash o))))
+(defn hash [o]
+  (cond
+    (satisfies? IHash o false)
+    (-hash ^not-native o)
+
+    (number? o)
+    (js-mod (.floor js/Math o) 2147483647)
+
+    (true? o) 1
+
+    (false? o) 0
+
+    (string? o)
+    (check-string-hash-cache o)
+    
+    :else
+    (-hash o)))
 
 (defn ^boolean empty?
   "Returns true if coll has no items - same as (not (seq coll)).


(defn ^boolean list? [x]
  (satisfies? IList x))

(extend-type string
  IHash
  (-hash [o] (goog.string/hashCode o)))

(deftype Keyword [ns name fqn ^:mutable _hash]
  Object

                   (bit-shift-right seed 2))))

(defn- hash-coll [coll]
  (if (seq coll)
    (loop [res (hash (first coll)) s (next coll)]
      (if (nil? s)
        res
        (recur (hash-combine res (hash (first s))) (next s))))
    0))

(declare key val)

