Open BartMassey opened 10 months ago
Closed by #285.
+1
IIUC, the linked documentation itself contradicts the text in Filling in Random Bits:
For example, the standard implementation of Hash for &str passes an extra 0xFF byte to the Hasher so that the values ("ab", "c") and ("a", "bc") hash differently.
In the section Filling In Random Bits is written:
Unfortunately, the example is wrong: the two slices given hash to different values, since the length of each
str
is hashed into the collection. A better example is to use()
: since unit contains no data it and slices of them are zero-sized types and all just produce the initial hash value.This repo provides a demonstration of the issue.
I will provide a PR to fix in a moment.