-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Clarify documentation of hash::SipHasher #32091
Clarify documentation of hash::SipHasher #32091
Conversation
cc @rust-lang/libs |
Since we want to change so that this is not the default hash algorithm for hashmaps, maybe we shouldn't say anything about how it's used? It's not really relevant (as documentation for this API item). Below that, "cryptographically strong" by itself is misleading, leads people to think about cryptographic hash functions (this is not one), so we should remove that. |
I think it's worth keeping that in there for reference until such time that it is no longer the default (as I'm guessing that at least some people have wanted to know what the default hash function is).
Good point! Updated in 054196d. |
/// such as `rand::Rng`. | ||
/// This is the default hashing function used by standard library (eg. | ||
/// [`collections::HashMap`](../collections/struct.HashMap.html) uses it by | ||
/// default). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link won't work in core's docs. Not sure we have any way to link this at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bluss: AFAIK it will work just fine on doc.rust-lang.org, which is where I believe the majority of users view these docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bluss: Oh, very true. I removed the link. 😄
The docs were making assertions/recommendations they shouldn't have. This clarifies them and adds some helpful links. Fixes rust-lang#32043.
2937a41
to
054196d
Compare
/// runs at good speed (competitive with spooky and city) and permits | ||
/// strong _keyed_ hashing. Key your hashtables from a strong RNG, | ||
/// such as `rand::Rng`. | ||
/// This is the default hashing function used by standard library (eg. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this could say "this is currently the default" to emphasize that it may change over time?
I will gladly accept whatever you deem is best here. |
I'll get the edits in tonight so y'all can review tomorrow!
|
@alexcrichton: Fixed in 46dc35e. 😄 |
…ion, r=alexcrichton Clarify documentation of hash::SipHasher The docs were making assertions/recommendations they shouldn't have. This clarifies them and adds some helpful links. Fixes rust-lang#32043. r? @sfackler
…ion, r=alexcrichton Clarify documentation of hash::SipHasher The docs were making assertions/recommendations they shouldn't have. This clarifies them and adds some helpful links. Fixes rust-lang#32043. r? @sfackler
The docs were making assertions/recommendations they shouldn't have. This clarifies them and adds some helpful links.
Fixes #32043.
r? @sfackler