arrow-core-data / arrow.typeclasses / Hash

Hash

interface Hash<in F> : Eq<F>

A type class used to represent hashing for objects of type F

A hash function is a mapping of arbitrary data (F) to an output set of fixed size (Int). The result, a hash value, is most commonly used in collections like HashTable as a lookup value

Functions

hash Produces a hash for an object of type F.abstract fun F.hash(): Int

Companion Object Functions

any Retrieve an instance of Hash where the hash function delegates to kotlin’s Any?.hashCode() functionfun any(): Hash<Any?>
invoke Construct an instance of Hash from a function (F) -> Int.operator fun <F> invoke(hashF: (F) -> Int): Hash<F>

Do you like Arrow?

Arrow Org
<