mscdex / node-xxhash

An xxhash binding for node.js
Other
193 stars 28 forks source link

Error in getting the hash value #20

Open binishbala opened 6 years ago

binishbala commented 6 years ago

Hi, The hash value generated using the node-xxhash in node and net.jpountz.xxhash.XXHash32 in java are different. Please find the sample code and result when tried the generation of hash value of same string in java and node. Let me if i am doing any thing wrong.

In Node

var key = "Testkey" var data = Buffer.from(key); var SEED = 4321; var hash = XXHash.hash(data, SEED); console.log(hash); Result : 3297801581

In Java

String key = "Testkey"; int SEED = 4321; byte[] data = key.getBytes(); int hash = hash32.hash(data, 0, data.length, SEED); System.out.println("hash value" + hash);

Result : hash value-997165715

Thanks Binish

mscdex commented 6 years ago

Can you try the master branch?

binishbala commented 6 years ago

Able to see only master branch for the node. Checked out the master branch of the java code. After this also getting the different hash code in java and javascript.

mscdex commented 6 years ago

I meant the master branch for this module (xxhash).

binishbala commented 6 years ago

Still the same result.