murmurhash-js icon indicating copy to clipboard operation
murmurhash-js copied to clipboard

Murmurhash doesn't equal known murmurhashes.

Open guloic opened this issue 5 years ago • 2 comments

Environment

System: Windows 10, 64 bit. Nodejs Version: 10.23.2

Steps to Reproduce

// add at the end of murmurhash2_gc.js
module.exports.murmurhash2_32_gc = murmurhash2_32_gc;

// add at the end of murmurhash3_gc.js
module.exports.murmurhash3_32_gc = murmurhash3_32_gc;

// then run the following code
var mmh2 = require('./murmurhash2_gc.js')

mmh2.murmurhash2_32_gc('foo')
// prints 2414502773

var mmh3 = require('./murmurhash3_gc.js')

mmh3.murmurhash3_32_gc('foo');
// prints 4138058784

Expected

One of those outputs needs to be equal to -156908512 which is the known murmurhash for foo

guloic avatar Feb 27 '21 02:02 guloic

Created PR - https://github.com/garycourt/murmurhash-js/pull/15/files

guloic avatar Feb 27 '21 03:02 guloic

Gary's version is returning the unsigned value, which is the correct value per https://github.com/hajimes/mmh3#how-to-use

wpwoodjr avatar Apr 19 '23 13:04 wpwoodjr