-
Notifications
You must be signed in to change notification settings - Fork 8
feat: add xxhash64 #39
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
Conversation
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.
Pull request overview
This PR adds an xxhash64 implementation to the hash module, matching the DataSketches Java behavior. The implementation provides a fast, non-cryptographic 64-bit hash function with seeded hashing support.
- Implements
XxHash64struct with the standardHashertrait - Provides both streaming API (
write/finish64) and convenience method (hash_u64) - Includes comprehensive test coverage with reference test vectors for verification
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/hash/xxhash.rs | New complete implementation of xxhash64 with constants, hasher struct, trait implementations, helper functions, and test suite |
| src/hash/mod.rs | Adds module declaration and public export for XxHash64 (with unused_imports attribute as hash module is currently internal-only) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
I think we should wait for sketches that need xxhash before shipping it ourselves. cc @tisonkun |
Agree. We can hold this PR for now. Whether or not publish the hash function is still under discussion, somehow datasketches-java and dataskecthes-cpp use them internally and datasketches-go clearly define the hash function internally. Seems mainly BloomFilter uses XxHash. @PsiACE you can take a look at #5 to see where we can have those sketches and xxhash as part of its implementation. |
|
I am working on a implementation of bloom filters at the moment. I can rework it to use this PR. |
Great! When it is desired, you can use |
Signed-off-by: Chojan Shang <[email protected]>
I just found that we've implemented murmur3hash ourselves, while Java also implements xxhash.