hash

added
1.0

ns
clojure.core

type
function

(hash x)

Returns the hash code of its argument. Note this is the hash code
consistent with =, and thus is different than .hashCode for Integer,
Short, Byte and Clojure collections.

                user=> (hash "a")
1455541201
user=> (.hashCode "a")  ; notice that this is different than (hash "a")
97
user=> (hash 1)
1392991556
user=> (.hashCode 1)    ; notice that this is different than (hash 1)
1
user=> (hash nil)
0
user=> (hash [1 2 3])
30817
user=> (hash [1 2 3 4])
955331