Incorrect hasher for AlignedBytes
#33
Labels
bug
Something isn't working
go ahead
Reviewed, implementation can start
good first issue
Good for newcomers
help wanted
Extra attention is needed
Describe the bug
Implementation of
std::hash::Hash
forAlignedBytes
is incorrect.MRE
Expected behavior
Sequences of bytes with the same contents should have equal hashes.
Workarounds (optional)
Casting to
&[u8]
and then hashing works:Proposed solution (optional)
The hash implementation hashes the pointer to the slice. It should just delegate to
[u8]
's impl ofHash
.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: