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

What's the relation with the rustc-hash crate? #10

Open
Apanatshka opened this issue Sep 24, 2019 · 2 comments
Open

What's the relation with the rustc-hash crate? #10

Apanatshka opened this issue Sep 24, 2019 · 2 comments

Comments

@Apanatshka
Copy link

I've noticed that FxHash(Map/Set) is also available in https://github.com/rust-lang/rustc-hash. How do the two crates relate? It looks like the same name/description. Which one should be preferred?

@cbreeden
Copy link
Owner

They both use the same hashing mechanism: self.hash.rotate_left(5).bitxor(i).wrapping_mul(K); With a quick glance, it looks like the only difference is that this crate provides a 32 and 64 bit variant (ignoring the target platform). I think I needed that because procedural macros was detecting the current platform as the target platform, so I needed to swap out FxHash with FxHash32/64 within the procedural macro.

Otherwise, I'd probably prefer rustc-hash for it's simplicity (and they will probably maintain it :P).

@Apanatshka
Copy link
Author

Cool, then I'll use the rustc-hash crate I guess :)
Perhaps this is something to add to the crate README?

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

No branches or pull requests

2 participants