justinwsmith / ruby-xxhash

A pure Ruby implementation of xxhash.
MIT License
23 stars 1 forks source link

Planned support for XXH128 or XXH3? #2

Open todd-a-jacobs opened 1 year ago

todd-a-jacobs commented 1 year ago

A pure Ruby implementation is nice, as most other gems like xxhash are really just wrappers around the xxhash binary. However, the xxhash binary now supports two new protocols: a dedicated 128-bit hash as XXH128, and a new algorithm (XXH3) which supports both 64- and 128-bit hashes even on 32-bit systems.

It would be great to see support for this in the pure Ruby implementation. I took a quick look at the code, and it looks more math-heavy than I feel comfortable generating a pull request for. I could help with scaffolding, documentation, or other things, but the actual algorithmic implementation is something I'd rather leave to someone who understands that part better than I do.

Are there any plans to add support for these two hash types?

justinwsmith commented 1 year ago

Thanks for the offer to help!

It's been awhile since I've worked in Ruby. I'll spend some time looking into this today to see how difficult those algorithms might be to implement.

justinwsmith commented 1 year ago

I started a branch for this work here: https://github.com/justinwsmith/ruby-xxhash/tree/xxh3

So far, I only added a few test vectors. Feel free to PR changes you think might be useful for that branch.