murmurhash-js
murmurhash-js copied to clipboard
Murmurhash doesn't equal known murmurhashes.
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
Created PR - https://github.com/garycourt/murmurhash-js/pull/15/files
Gary's version is returning the unsigned value, which is the correct value per https://github.com/hajimes/mmh3#how-to-use