diff options
| author | Tyson Nottingham <tgnottingham@gmail.com> | 2020-09-28 17:34:27 -0700 |
|---|---|---|
| committer | Tyson Nottingham <tgnottingham@gmail.com> | 2020-09-30 00:57:35 -0700 |
| commit | d061fee177c70ae146db2b9720c85dc1f38215af (patch) | |
| tree | 8091284d09715d640701de43d3907f2546047f0a /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | fc2daaae610b5515438b551a2f3706196a997f35 (diff) | |
| download | rust-d061fee177c70ae146db2b9720c85dc1f38215af.tar.gz rust-d061fee177c70ae146db2b9720c85dc1f38215af.zip | |
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.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
