HashDepot icon indicating copy to clipboard operation
HashDepot copied to clipboard

Implement awareness for big-endian systems

Open RenzoCoppola opened this issue 7 years ago • 3 comments

Would these hash functions give me different results in different machines with different endianness?

RenzoCoppola avatar Jan 26 '18 00:01 RenzoCoppola

Good question. I don't have tests for endianness and definitely haven't written the code with endianness in mind. I only tested it on little endian. Let me check this out.

ssg avatar Jan 26 '18 00:01 ssg

I checked this out (finally), SipHash and MurmurHash seem to be endianness sensitive. Fnv1 and Fnv1a should be okay. Changes needed to make them endian-aware.

ssg avatar Jan 25 '19 04:01 ssg

Self-note: BitConverter.ToXIntYY() methods actually take endianness into account. So, as long as you use those endianness shouldn't be an issue.

ssg avatar Aug 24 '19 21:08 ssg

This shouldn't be an issue anymore as the library's using .NET's bit conversion algo now.

ssg avatar Nov 10 '22 07:11 ssg