MurmurHash3
An implementation of Austin Appleby's MurmurHash 3 algorithm (MurmurHash3_x86_32).
An implementation of Austin Appleby's MurmurHash 3 algorithm
(MurmurHash3_x86_32). This object contains methods that hash
values of various types as well as means to construct Hashing
objects.
This algorithm is designed to generate well-distributed non-cryptographic hashes. It is designed to hash data in 32 bit chunks (ints).
The mix method needs to be called at each step to update the intermediate hash value. For the last chunk to incorporate into the hash mixLast may be used instead, which is slightly faster. Finally finalizeHash needs to be called to compute the final hash value.
This is based on the earlier MurmurHash3 code by Rex Kerr, but the MurmurHash3 algorithm was since changed by its creator Austin Appleby to remedy some weaknesses and improve performance. This represents the latest and supposedly final version of the algorithm (revision 136). Even so, test the generated hashes in between Scala versions, even for point releases, as fast, non-cryptographic hashing algorithms evolve rapidly.
- See also
Type members
Classlikes
Value members
Inherited methods
Compute the hash of an array.
Compute the hash of an array. Potential range hashes are recognized to produce a hash that is compatible with rangeHash.
- Inherited from
- MurmurHash3
Compute the hash of a byte array.
Compute the hash of a byte array. Faster than arrayHash, because it hashes 4 bytes at once. Note that the result is not compatible with arrayHash!
- Inherited from
- MurmurHash3
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.
- Inherited from
- MurmurHash3
Compute the hash of an IndexedSeq.
Compute the hash of an IndexedSeq. Potential range hashes are recognized to produce a hash that is compatible with rangeHash.
- Inherited from
- MurmurHash3
Compute the hash of a List.
Compute the hash of a List. Potential range hashes are recognized to produce a hash that is compatible with rangeHash.
- Inherited from
- MurmurHash3
Mix in a block of data into an intermediate hash value.
Mix in a block of data into an intermediate hash value.
- Inherited from
- MurmurHash3
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.
- Inherited from
- MurmurHash3
Compute a hash that depends on the order of its arguments.
Compute a hash that depends on the order of its arguments. Potential range hashes are recognized to produce a hash that is compatible with rangeHash.
- Inherited from
- MurmurHash3
Compute the hash of a Range with at least 2 elements.
Compute the hash of a Range with at least 2 elements. Ranges with fewer
elements need to use seqHash instead. The last
parameter must be the
actual last element produced by a Range, not the nominal end
.
- Inherited from
- MurmurHash3
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.
- Inherited from
- MurmurHash3