-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix Endianness / portability ? #3
Comments
It may be a matter of adding some Is there any easy way of testing such things in a x64 laptop? |
Best option may be cross-compiling on Travis (see trust; you can remove parts of the |
I think fixing Endianness is mostly about calling There is a note on portability at the bottom of the original implementation's README. Whether you want to differ from his direction here I guess you have to decide — if you do, results won't be compatible (on BE machines, which may be irrelevant). The wrapper mentioned above is another possibility for users, but this should be documented. |
I notice that this uses the simplest implementation of
Hasher
possible. Functions likewrite_u16
cast multi-byte numbers to byte-slices without fixing Endianness; this implies one should get different results on Big Endian vs Little Endian machines.I don't know whether this is the only portability issue (e.g. I don't know if there are any complications if the
bytes
supplied towrite
are not sufficiently aligned; presumably only performance).Now, I'm not sure whether to call the lack of Endianness fixing in
Hasher
default function impls a bug in the standard library or not, but it's a problem for our use-case (not certain whether we will use MetroHash yet). We could simply wrap withHasherToLE
(endian-hasher), but that seems messy.Your thoughts?
The text was updated successfully, but these errors were encountered: