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

Stable hashing: add comments and tests concerning platform-independence #77319

Merged
merged 1 commit into from
Oct 1, 2020

Commits on Sep 30, 2020

  1. Stable hashing: add comments and tests concerning platform-independence

    SipHasher128 implements short_write in an endian-independent way, yet
    its write_xxx Hasher trait methods undo this endian-independence by byte
    swapping the integer inputs on big-endian hardware. StableHasher then
    adds endian-independence back by also byte-swapping on big-endian
    hardware prior to invoking SipHasher128.
    
    This double swap may have the appearance of being a no-op, but is in
    fact by design. In particular, we really do want SipHasher128 to be
    platform-dependent, in order to be consistent with the libstd SipHasher.
    Try to clarify this intent. Also, add and update a couple of unit tests.
    tgnottingham committed Sep 30, 2020
    Configuration menu
    Copy the full SHA
    d061fee View commit details
    Browse the repository at this point in the history