stop Hash implementation for str from writing extra byte.#25237
stop Hash implementation for str from writing extra byte.#25237cpjreynolds wants to merge 1 commit intorust-lang:masterfrom cpjreynolds:hash-fix
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see CONTRIBUTING.md for more information. |
|
The byte is actually quite important: it is designed to protect against trivial hash-collisions, e.g. without the byte, Thanks for the PR, but unfortunately we can't accept it. |
Calling hash() on a str eg:
Results in an extra 0xFF byte being written into the hasher after the string.
This is a simple PR that stops the extra byte from being written.