function | since v0.0-2261 | Edit |
(hash-string k)
(defn hash-string [k]
(when (> string-hash-cache-count 255)
(set! string-hash-cache (js-obj))
(set! string-hash-cache-count 0))
(if (nil? k)
0
(let [h (unchecked-get string-hash-cache k)]
(if (number? h)
h
(add-to-string-hash-cache k)))))