ExHashRing.Hash (ex_hash_ring v7.0.0)

View Source

Hash encapsulates the hashing logic for converting keys into ring locations.

Any term that implements the String.Char protocol can be used as a key.

Summary

Types

Any term that can be coerced into a string (String.Chars.t()) is a hashable term.

t()

Hash for the term, this is used to locate Nodes in the Ring

Functions

Calculate a hash of the hashable term.

Types

hashable()

@type hashable() :: String.Chars.t()

Any term that can be coerced into a string (String.Chars.t()) is a hashable term.

t()

@type t() :: integer()

Hash for the term, this is used to locate Nodes in the Ring

Functions

of(key)

@spec of(hashable()) :: t()

Calculate a hash of the hashable term.