ssg / HashDepot

.NET library for xxHash, FNV, MurmurHash3 and SipHash algorithms
MIT License
134 stars 16 forks source link

Implement awareness for big-endian systems #2

Closed RenzoCoppola closed 1 year ago

RenzoCoppola commented 6 years ago

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

ssg commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

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

ssg commented 1 year ago

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