class

Hasher(T)

Inherits Reference < Object

Abstract base class for consistent hash implementations. Provides a common interface for different hashing algorithms.

Instance methods

add(key : String, weight : UInt32, target : T)

Add a target to the hasher with the given key and weight. The weight determines how many "slots" or "virtual nodes" the target occupies.

Source
get(key : String) : T | Nil

Get the target for the given key, or nil if no targets exist.

Source
remove(key : String, weight : UInt32)

Remove a target from the hasher using its key and weight. The weight must match what was used when adding.

Source