MetroHash has different hashing than MurmurHash3 in Javascript?

247 Views Asked by At

So in when i use in Javascript murmurhash-native/stream like so:

const murmur = require("murmurhash-native/stream");



const hash = murmur.createHash("murmurhash128");
hash.update('hash').digest('hex');


console.log(hash.digest("hex"));

the console.log result is:

4ab2e1e022f63e2e9add75dfcea2dede

However, using MetroHash in Python with the following setup:

import metrohash



m = metrohash.MetroHash128(0)
m.update("hash")

print(m.hexdigest())

i get on the otherhand from the print the value

e8a8b5ad0ae42fb46ab073e8bd98479a

Am I doing something wrong? As far as I understood metrohash.MetroHash128 is used for incremental hashing, which is exactly what im looking for in Python, but somehow the result values are for the same input different.

Ive checked if there is any other library that supports incremental hashing in Python, but it seems MetroHash is so far the only one?

Any help would be appreciated!

Thanks in advance!

0

There are 0 best solutions below