MurmurHash

@ccompatUsedUntil213
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.

Source:
MurmurHash.scala
class Object
trait Matchable
class Any

Value members

Concrete methods

Compute a high-quality hash of an array

Compute a high-quality hash of an array

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

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

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

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

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

Begin a new hash with a seed value.

Begin a new hash with a seed value.

Source:
MurmurHash.scala

The initial magic integers in the first stream.

The initial magic integers in the first stream.

Source:
MurmurHash.scala

The initial magic integer in the second stream.

The initial magic integer in the second stream.

Source:
MurmurHash.scala

Compute a high-quality hash of a string

Compute a high-quality hash of a string

Source:
MurmurHash.scala
@nowarn("msg=deprecated")
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.

Source:
MurmurHash.scala