MurmurHash

org.apache.pekko.routing.MurmurHash
object MurmurHash

An object designed to generate well-distributed non-cryptographic hashes. It is designed to hash a collection of integers; along with the integers to hash, it generates two magic streams of integers to increase the distribution of repetitive input sequences. Thus, three methods need to be called at each step (to start and to incorporate a new integer) to update the values. Only one method needs to be called to finalize the hash.

Attributes

Source
MurmurHash.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
MurmurHash.type

Members list

Value members

Concrete methods

def arrayHash[T](a: Array[T]): Int

Compute a high-quality hash of an array

Compute a high-quality hash of an array

Attributes

Source
MurmurHash.scala
def extendHash(hash: Int, value: Int, magicA: Int, magicB: Int): Int

Incorporates a new value into an existing hash.

Incorporates a new value into an existing hash.

Value parameters

hash

the prior hash value

magicA

a magic integer from the stream

magicB

a magic integer from a different stream

value

the new value to incorporate

Attributes

Returns

the updated hash value

Source
MurmurHash.scala
def finalizeHash(hash: Int): Int

Once all hashes have been incorporated, this performs a final mixing

Once all hashes have been incorporated, this performs a final mixing

Attributes

Source
MurmurHash.scala
def nextMagicA(magicA: Int): Int

Given a magic integer from the first stream, compute the next

Given a magic integer from the first stream, compute the next

Attributes

Source
MurmurHash.scala
def nextMagicB(magicB: Int): Int

Given a magic integer from the second stream, compute the next

Given a magic integer from the second stream, compute the next

Attributes

Source
MurmurHash.scala
def startHash(seed: Int): Int

Begin a new hash with a seed value.

Begin a new hash with a seed value.

Attributes

Source
MurmurHash.scala

The initial magic integers in the first stream.

The initial magic integers in the first stream.

Attributes

Source
MurmurHash.scala

The initial magic integer in the second stream.

The initial magic integer in the second stream.

Attributes

Source
MurmurHash.scala
def stringHash(s: String): Int

Compute a high-quality hash of a string

Compute a high-quality hash of a string

Attributes

Source
MurmurHash.scala
def symmetricHash[T](xs: IterableOnce[T], seed: Int): Int

Compute a hash that is symmetric in its arguments--that is, where the order of appearance of elements does not matter. This is useful for hashing sets, for example.

Compute a hash that is symmetric in its arguments--that is, where the order of appearance of elements does not matter. This is useful for hashing sets, for example.

Attributes

Source
MurmurHash.scala