about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2024-02-19 13:58:04 +0100
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2024-02-19 14:08:49 +0100
commitbc1bca798f6ab91bb513ae010c5a99f91639b125 (patch)
treec0e191ac71584b9f4df73c2d4c00744c93d797f2 /tests/codegen/src-hash-algorithm
parente4584e84d9a4687bedf1481b60c1751a2478967c (diff)
downloadrust-bc1bca798f6ab91bb513ae010c5a99f91639b125.tar.gz
rust-bc1bca798f6ab91bb513ae010c5a99f91639b125.zip
Fix download hash check on big-endian systems
Ensure the hash_file and hash_dir routines give identical results
on big- and little-endian systems.  The default hash routines for
integer types are endian-dependent, so all such hash inputs need
to be byte-swapped.

This applies in particular to the file hashes used as input when
computing directory hashes.

In addition, the default hash routines for composite types use
a length prefix, which it itself an integer type (usize).  In
order to be able to byte-swap that prefix, we have to re-implement
those bits of the standard library ourselves.
Diffstat (limited to 'tests/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions