Questions tagged [murmurhash]

MurmurHash is a non-cryptographic hash function suitable for general hash-based lookup.

Murmurhash generates roughly the same number of collisions as alternate hashes over a wide range of input data.

95 questions
95
votes
2 answers

MurmurHash - what is it?

I've been trying to get a high level understanding of what MurmurHash does. I've read a basic description but have yet to find a good explanation of when to use it and why. I know its very fast but want to know a bit more. I asked a related…
seedhead
  • 3,655
  • 4
  • 32
  • 38
25
votes
5 answers

Is there a pure python implementation of MurmurHash?

I need (and can't find) a pure python (no c++) implementation of MurmurHash, and I'm too novice to write myself. Speed or memory usage doesn't matter on my project. I find a attempt here, but it's limited to 31bits hash and I really need a 64bits…
greg
  • 2,339
  • 1
  • 18
  • 23
22
votes
2 answers

Fastest way to generate hash function from k wise independent hash family for small k(<=5)

I need a hash function h[n]:[t] from k wise independent hash family when k is small (<= 5). Or I need n hash values chosen uniformly randomly from [1-t] such that they are k wise independent. I am trying to implement some randomized algorithms where…
user1131274
  • 493
  • 6
  • 20
21
votes
3 answers

Is any 64-bit portion of a 128-bit hash as collision-proof as a 64-bit hash?

We're trying to settle an internal debate on our dev team: We're looking for a 64-bit PHP hash function. We found a PHP implementation of MurmurHash3, but MurmurHash3 is either 32-bit or 128-bit, not 64-bit. Co-worker #1 believes that to produce a…
richardkmiller
  • 2,902
  • 3
  • 31
  • 29
14
votes
3 answers

Bloom filters and its multiple hash functions

I'm implementing a simple Bloom filter as an exercise. Bloom filters require multiple hash functions, which for practical purposes I don't have. Assuming I want to have 3 hash functions, isn't it enough to just take the hash of the object I'm…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
11
votes
7 answers

Fast hash function with collision possibility near SHA-1

I'm using SHA-1 to detect duplicates in a program handling files. It is not required to be cryptographic strong and may be reversible. I found this list of fast hash functions https://code.google.com/p/xxhash/ (list has been moved to…
Stig
  • 1,974
  • 2
  • 23
  • 50
8
votes
2 answers

Murmurhash 2 results on Python and Haskell

Haskell and Python don't seem to agree on Murmurhash2 results. Python, Java, and PHP returned the same results but Haskell don't. Am I doing something wrong regarding Murmurhash2 on Haskell? Here is my code for Haskell Murmurhash2: import…
Axel Advento
  • 2,995
  • 3
  • 24
  • 32
7
votes
2 answers

Migrate from MurmurHash to MurmurHash3

In Scala 2.10, MurmurHash for some reason is deprecated, saying I should use MurmurHash3 now. But the API is different, and there is no useful scaladocs for MurmurHash3 -> fail. For instance, current code: trait Foo { type Bar def id: Int def…
0__
  • 66,707
  • 21
  • 171
  • 266
7
votes
3 answers

MurmurHash3 Test Vectors

I'm trying to port a C# implementation of MurmurHash3 to VB.Net. It runs... but can someone provide me with some known Test Vectors to verify correctness? Known string text Seed value Result of MurmurHash3 Thanks in advance. Edit : I'm limiting…
pepoluan
  • 6,132
  • 4
  • 46
  • 76
6
votes
2 answers

Scala MurmurHash3 library not matching Python mmh3 library

I have a need to MurmurHash strings in both Python and Scala. However they are giving very different results. Scala's builtin MurmurHash3 library does not seem to give the same results as any of the other libraries I have tried including online…
patrickbarker
  • 393
  • 1
  • 4
  • 13
5
votes
2 answers

How to create a custom Murmur Avalanche Mixer?

I'm trying to use an Avalanche mixer to hash integer coordinates. I've been using Murmur3's 32bit and 64bit avalanche mixers to do so (and not the actual total hash function). For my application the entire hash function is not needed, only the…
Krupip
  • 4,404
  • 2
  • 32
  • 54
5
votes
3 answers

Having negative values using Apache MurmurHash3.java x86 32 bits method

I have to use an x86 32 bits murmurhash to determinate the partition in which I send messages in Kafka. Another application is using NodeJS murmurhash.v3() method to get the messages from the expected partition. I tried two methods : First, I got…
5
votes
3 answers

How can I use Scala's MurmurHash implementation: scala.util.MurmurHash3?

I'm writing a BloomFilter and wanted to use Scala's default MurmurHash3 implementation: scala.util.MurmurHash3. My compile is failing however with the following compile error: [error]…
dr.
  • 247
  • 1
  • 5
  • 13
4
votes
1 answer

Murmur3 Hash Compatibility Between Go and Python

We have two different libraries, one in Python and one in Go that need to compute murmur3 hashes identically. Unfortunately no matter how hard we try, we cannot get the libraries to produce the same result. It appears from this SO question about…
bbengfort
  • 5,254
  • 4
  • 44
  • 57
4
votes
2 answers

Ruby internals and how to guarantee unique hash values

Hash in Ruby just uses its hash value (for strings and numbers). Internally, it uses the Murmur hash function. I wonder how it can can be done given that the probability of having the same hash value for two different keys is not zero.
Marco
  • 783
  • 5
  • 21
1
2 3 4 5 6 7