Compute the hash of an array.
Compute the hash of an array.
Compute the hash of a byte array.
Compute the hash of a byte array. Faster than arrayHash, because it hashes 4 bytes at once.
Finalize a hash to incorporate the length and make sure all bits avalanche.
Finalize a hash to incorporate the length and make sure all bits avalanche.
Mix in a block of data into an intermediate hash value.
Mix in a block of data into an intermediate hash value.
May optionally be used as the last mixing step.
May optionally be used as the last mixing step. Is a little bit faster than mix, as it does no further mixing of the resulting hash. For the last element this is not necessary as the hash is thoroughly mixed during finalization anyway.
Compute a hash that depends on the order of its arguments.
Compute a hash that depends on the order of its arguments.
Compute the hash of a product
Compute the hash of a product
To offer some potential for optimization.
Compute the hash of a string
Compute the hash of a string
Compute a hash that is symmetric in its arguments - that is a hash where the order of appearance of elements does not matter.
Compute a hash that is symmetric in its arguments - that is a hash where the order of appearance of elements does not matter. This is useful for hashing sets, for example.
def linearSeqHash(xs: collection.
def linearSeqHash(xs: collection.LinearSeq[_], seed: Int): Int = { var n = 0 var h = seed var elems = xs while (elems.nonEmpty) { h = mix(h, elems.head.##) n += 1 elems = elems.tail } finalizeHash(h, n) }
def indexedSeqHash(xs: collection.IndexedSeq[_], seed: Int): Int = { var n = 0 var h = seed val len = xs.length while (n < len) { h = mix(h, xs(n).##) n += 1 } finalizeHash(h, n) }
(Since version 2.10.0) Use unorderedHash
(Since version 2.10.0) Use orderedHash
An instance of MurmurHash3 with predefined seeds for various classes. Used by all the scala collections and case classes.