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

Add FnvHasher::with_key() #11

Merged
merged 2 commits into from Jul 14, 2016
Merged

Add FnvHasher::with_key() #11

merged 2 commits into from Jul 14, 2016

Conversation

Manishearth
Copy link
Member

@Manishearth Manishearth commented Jul 14, 2016

This change is Reviewable

@@ -78,6 +78,12 @@ impl Default for FnvHasher {
}
}

impl FnvHasher {
pub fn with_key(key: u64) -> FnvHasher {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs docs

@Ms2ger
Copy link
Contributor

Ms2ger commented Jul 14, 2016

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit cfd612c has been approved by Ms2ger

@bors-servo
Copy link
Contributor

⌛ Testing commit cfd612c with merge 65c1c07...

bors-servo pushed a commit that referenced this pull request Jul 14, 2016
Add FnvHasher::with_key()

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-fnv/11)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - travis

@bors-servo bors-servo merged commit cfd612c into servo:master Jul 14, 2016
@SimonSapin
Copy link
Member

I was worried about how letting the user choose this number would affect the properties of the hash algorithm. It turns out:

http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param

In the general case, almost any offset_basis will serve so long as it is non-zero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants