Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hex encbuf returns big endian #33

Open
clytras opened this issue Feb 27, 2020 · 0 comments
Open

hex encbuf returns big endian #33

clytras opened this issue Feb 27, 2020 · 0 comments

Comments

@clytras
Copy link

clytras commented Feb 27, 2020

const XXHash = require('xxhash');

const seed = 0xA0B0C0D0;

const s1 = XXHash.hash(Buffer.from('test1234'), seed);
const s1hex =  XXHash.hash(Buffer.from('test1234'), seed, 'hex');

console.log(`s1:`, s1.toString(16));
// s1: 19c64649

console.log(`s1hex:`, s1hex);
// s1hex: 4946c619

Why bufenc hex returns a big endian? Is this intentional? I believe that can lead to many headaches when generating hashes using xxhash from multiple systems.

Tested on Ubuntu 16 and Windows 10 using node 10.19.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant