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
4
votes
2 answers

Different results from Murmur3 from Scala and Guava

I am trying to generate hashes using the Murmur3 algorithm. The hashes are consistent but they are different values being returned by Scala and Guava. class package$Test extends FunSuite { test("Generate hashes") { println(s"Seed =…
Saket
  • 3,079
  • 3
  • 29
  • 48
4
votes
1 answer

how to have different source code when cross-compiling Scala with sbt? (changes in MurmurHash)

I am using SBT 0.13.2 (could be e.g. 0.13.5 just as well) and am trying to take a project written for 2.10 and cross-compile it for both 2.9 and 2.10. It uses scala.util.hashing.MurmurHash3, which doesn't exist in 2.9; instead there's…
Urban Vagabond
  • 7,282
  • 3
  • 28
  • 31
4
votes
1 answer

what does parameters in murmurhash3 mean?

I am confused with what value should I provide for the len parameter in the MurmurHash3_x86_128() function (and there are similar functions also). The murmurhash3 code can be found here. If your answer is that it is the length of the key then please…
Aman Deep Gautam
  • 8,091
  • 21
  • 74
  • 130
3
votes
3 answers

How to use MurmurHash 64 in Objective-C?

I need to Hash a NSString using murmurhash i am forced to do that because the other team is doing so, I need to use the 64-bit key length on x86 platform, have anyone implemented or used murmurhash in objective-C? Murmurhash 64 is a .cpp file and i…
Ahmad Kayyali
  • 8,233
  • 13
  • 49
  • 83
3
votes
1 answer

get murmur hash of a file with Python 3

The documentation for the python library Murmur is a bit sparse. I have been trying to adapt the code from this answer: import hashlib from functools import partial def md5sum(filename): with open(filename, mode='rb') as f: d =…
cardamom
  • 6,873
  • 11
  • 48
  • 102
3
votes
0 answers

How does the quality of 128 bit MurmurHash3 change in case of small key length or output truncation?

I have 64bit machine and I want to use 128 bits murmurhash3 due to its speed (MurmurHash3_x64_128 function in https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp). But the thing is my inputs to this hash function won't be more than…
Ugur Yilmaz
  • 156
  • 1
  • 7
3
votes
1 answer

Generate C* bucket hash from multipart primary key

I will have C* tables that will be very wide. To prevent them to become too wide I have encountered a strategy that could suit me well. It was presented in this video. Bucket Your Partitions Wisely The good thing with this strategy is that there is…
nicgul
  • 237
  • 1
  • 2
  • 10
3
votes
2 answers

Javascript implementation of Murmurhash3 to give the same result as Murmurhash3.cpp used by transform available in Python's sklearn

(I am VERY sorry I am not allowed to add many URLs to help me better explain my problems in this post because I am new on StackOverflow and my StackOverflow account has very low privilege). Summary Can anyone please guide me on how to modify…
emmanuelsa
  • 657
  • 6
  • 9
3
votes
1 answer

PHP Murmurhash3 and MySql Murmurhash3 sometimes don't match

I'm using Murmurhash3 to create unique hashes for text entries. When text entries are created, I'm using this php implementation, which returns a 32 bit hash integer, to get the hash value. The hash is stored in a BINARY(16) database column. I also…
revolt_101
  • 395
  • 3
  • 12
3
votes
1 answer

Using hashes as IDs in key-value stores

I'm wondering whether it would be a good idea to use hashes (CityHash, Murmur and the like) as keys in a key-value store like Hazelcast. I'm expecting to have about 2,000,000,000 records (URLs) in the database, so collisions could happen. It…
deamon
  • 89,107
  • 111
  • 320
  • 448
3
votes
2 answers

Murmur3 hash different result between Python and Java implementation

I have two different program that wish to hash same string using Murmur3 in Python and Java respectively. Python version 2.7.9: mmh3.hash128('abc') Gives 79267961763742113019008347020647561319L. Java is Guava 18.0: HashCode hashCode =…
michaelliu
  • 1,667
  • 2
  • 13
  • 13
3
votes
1 answer

Cassandra hashing algorithm with composite keys

I'm trying to understand what algorithm Cassandra uses to generate murmur3 hashes of composite partition keys. I know I can obtain the value directly from CQL but I want to reproduce the behaviour of Cassandra for any given tuple directly from…
Nicola Ferraro
  • 4,051
  • 5
  • 28
  • 60
3
votes
3 answers

How to generate Cassandra Token for composite partition key?

My Cassandra ColumnFamily uses the Murmur3Partitioner, and has a composite partition key. With this partitioner I was trying to create a Token, however it seems this token factory only allows Long values. Is it possible to generate these hashes for…
user3507166
  • 33
  • 1
  • 4
2
votes
2 answers

Zero-Allocation-Hashing murmur3: hashChars() and hashBytes() produce different output

I am not sure if I am using murmur3 (OpenHFT's zero-allocation-hashing) function correctly but the result seems different for hashChars() and hashBytes() // Using zero-allocation-hashing 0.16 String input =…
Nishant Kumar
  • 2,199
  • 2
  • 22
  • 43
2
votes
1 answer

ImportError: cannot import name 'hash_unicode'

While importing spacy using "import spacy", I am getting this error. ImportError Traceback (most recent call last) in ----> 1 import…
R Kumar
  • 471
  • 1
  • 6
  • 6