function | since v0.0-2261 | Edit |
(hash-string* s)
(defn hash-string* [s]
(if-not (nil? s)
(let [len (.-length s)]
(if (pos? len)
(loop [i 0 hash 0]
(if (< i len)
(recur (inc i) (+ (imul 31 hash) (.charCodeAt s i)))
hash))
0))
0))