Skip to content

clojure.core/hash

View this page on ClojureDocs

Type: function Added: Clojure 1.0 Examples: 3 Runnable: 1
([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.

Examples

by gstamp on . May have evaluation errors.
by jafingerhut on
by loeschzwerg on . May have evaluation errors.

Note by svenschoenung

Despite what the doc-string says values returned by (hash) are different from (.hashCode) for more than just Integer, Short, Byte and Clojure collections.

The list also includes: Keywords, Symbols, Functions, Sequences, String, Long and BigInteger (as of Clojure 1.7.0).

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.