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
0
votes
0 answers

How to use murmurhash function effectively for strings

I have to use a hash function for my code in C and I found murmurhash 3 (32 bit) hash function I presume. I have a problem understanding what to input as len and seed. I inputted arbitrary values as parameters into len and seed, which are 2,000…
0
votes
0 answers

Is there any quality difference between MurmurHash32 and static_cast(MurmurHash128)?

Given a message, MurmurHash3 can produce a 32-bit hash result or a 128-bit one. Message msg; char output_v32_a[4]; char output_v32_b[4]; char output_v128[16]; MurmurHash32(msg, output_v32_a); MurmurHash128(msg, output_v128); memcpy(output_v32_b,…
xmllmx
  • 39,765
  • 26
  • 162
  • 323
0
votes
1 answer

Pros and cons of using Murmur3 hash as a primary key in database

I'm working on creating database, there are multiple tables such as Apps, Space, Builds, Processes. The app which I'm going to use this database for is like a real-time dashboard for platform monitoring, and the database will update every second…
Jojo
  • 127
  • 1
  • 2
  • 12
0
votes
2 answers

What is the algorithm behind Cassandra's token function?

The Token function in my driver doesn't support a composite partition key, but it works very well with a single partition key, it takes a binary in 8 bits form as an input and pass it to murmur3 hash function and extract the 64-signed-little-integer…
aiomix
  • 11
  • 3
0
votes
1 answer

How to generate a 64bit Murmur hash v2 in PHP 7.2?

I've got a MySQL database that has some Murmur2 hashes (as unsigned 64bit ints) that were generated with the Percona UDF that comes with the Percona strand of MySQL database found here…
Brian Leishman
  • 8,155
  • 11
  • 57
  • 93
0
votes
1 answer

Generating multiple hash values for same key using murmerHash

I generating a bunch of hash values for the same key using MurmerHash like the following. It outputs 50 different hash values for 50 different seeds. for(int seed=0; seed<50; seed++) MurmurHash3_x86_32(key, strlen(key), seed, &hash); But it is…
viz12
  • 675
  • 1
  • 11
  • 20
0
votes
1 answer

Implement non-cryptographic hash functions in C

I was trying to implement hash table in C to store English words. So I was searching through the internet to some of the best non-cryptographic hash functions. Some of them are Murmurhash, Seahash, xxHash but they all seemed very difficult to…
0
votes
1 answer

Very basic MurmurHash questions: variable descriptions for len, key in C++ implementation

I'm trying to adapt MurmurHash into a program built for a class, but I can't seem to find explicit confirmation about what the variables represent. I'm using the following as reference: unsigned int MurmurHash2 ( const void * key, int len, unsigned…
0
votes
2 answers

How to spike hash function collision rate?

Given there are billions cookies, UUID like strings, what is the best way to test collision rate of say 32 bit hash function like murmur3 on this sample? First of all it is hard to generate billions of unique strings as it is impossible to keep it…
lisak
  • 21,611
  • 40
  • 152
  • 243
0
votes
1 answer

C++ MurmurHash3 : how to hash integer

I am confused with how should i call MurmurHash3_x86_128() with integer key value or is it even possible ? The murmurhash3 code can be found https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp. Method definition is given below. void…
rombi
  • 199
  • 3
  • 22
0
votes
2 answers

C++ MurmurHash3 returning same value for different key

I am confused with how should i call MurmurHash3_x86_128() when i have lot of key value. The murmurhash3 code can be found https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp. Method definition is given below. void…
rombi
  • 199
  • 3
  • 22
0
votes
0 answers

Inverse of MurmurHash3

I am looking for an inverse function of MurmurHash3_x64_128, as implemented in this Java version. Note that the difference is in initializing h1 and h2 by xoring the seed with some magic numbers. Also, in fact I am interested only in bits 33 - 64…
Radim Vansa
  • 5,686
  • 2
  • 25
  • 40
0
votes
1 answer

Java, make murmur2 hash work on portion of byte array

I'm using murmur2 hash on a byte array but I only want to hash a subset of the bytes, murmur2 only lets me hash the array starting from 0 but I want to specify a non 0 start offset as well as an end offset in the array. * * @param data byte…
daedalus
  • 105
  • 2
  • 10
0
votes
2 answers

Murmurhash3 between Java and C++ is not aligning

I have 2 separate applications one in Java and the other is C++. I am using Murmurhash3 for both. However, in C++ I get a different result as compared to Java for the same string Here is the one from C++:…
Masti
  • 151
  • 1
  • 10
0
votes
1 answer

google sparse hash with murmur hash function

How to use murmur hash function in google sparse hash map? Could you please give me step by step instructions on how to use murmur hash function? I'm using visual c++. Currently I'm using std::hash hash function in google sparse hash map. Is there…
user1815763
  • 103
  • 2
  • 10