Skip to content

Fix Endianness / portability ? #3

@dhardy

Description

@dhardy

I notice that this uses the simplest implementation of Hasher possible. Functions like write_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 to write 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 with HasherToLE (endian-hasher), but that seems messy.

Your thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions