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

Feature Request: ability to update xxh32 state #7

Open
warmwaffles opened this issue Aug 6, 2019 · 2 comments
Open

Feature Request: ability to update xxh32 state #7

warmwaffles opened this issue Aug 6, 2019 · 2 comments

Comments

@warmwaffles
Copy link

warmwaffles commented Aug 6, 2019

I have a use case where I need to accumulate data into the 4 vectors for state.

I'd love to be able to do something like this

xxh = XXHash.XXH32.init(123)
hexdigest = 
  xxh
  |> XXHash.XXH32.update("foo")
  |> XXHash.XXH32.update("bar")
  |> XXHash.XXH32.digest()
  |> Integer.to_string(16)

Currently I don't think this library really supports that and I am having a difficult time understanding how this could be shimmed in without some breaking changes.

Side note, xxh3 was released in v0.7 not too long ago seems interesting https://github.com/Cyan4973/xxHash#new-experimental-hash-algorithm

I'll fork this and see what I can come up with.

@warmwaffles
Copy link
Author

My temporary solution to unblock myself was to just append everything I wanted to a string and then call xxh32 on it.

@ttvd
Copy link
Owner

ttvd commented Aug 12, 2019

Hello! I don't have time to do this atm, but I will be more than happy to merge your changes!

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