Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

By default, HashMap does *not* use a cryptographically secure hashing function #1469

Merged
merged 2 commits into from
Sep 17, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Reword "cryptographically strong" SipHash
  • Loading branch information
oberien committed Sep 8, 2018
commit 9d800ad1f2a33ed552fbc28b8f54df3b27ad3537
4 changes: 3 additions & 1 deletion 2018-edition/src/ch08-03-hash-maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ loop, so all of these changes are safe and allowed by the borrowing rules.

### Hashing Functions

By default, `HashMap` uses a strong, but non-cryptographic, hashing function that can
By default, `HashMap` uses a "cryptographically strong"[^siphash] hashing function that can
provide resistance to Denial of Service (DoS) attacks. This is not the fastest
hashing algorithm available, but the trade-off for better security that comes
with the drop in performance is worth it. If you profile your code and find
Expand All @@ -273,6 +273,8 @@ hasher from scratch; [crates.io](https://crates.io) has libraries shared by
other Rust users that provide hashers implementing many common hashing
algorithms.

[^siphash]: [https://www.131002.net/siphash/siphash.pdf](https://www.131002.net/siphash/siphash.pdf)

## Summary

Vectors, strings, and hash maps will provide a large amount of functionality
Expand Down