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

Support for 128 or 256 bit hashes? #4

Open
mceachen opened this issue Jan 7, 2018 · 5 comments
Open

Support for 128 or 256 bit hashes? #4

mceachen opened this issue Jan 7, 2018 · 5 comments

Comments

@mceachen
Copy link

mceachen commented Jan 7, 2018

Thanks for this work!

Is there an API to switch the result buffer to render 128 bit or 256 bit hashes? Providing an HHResult128 or HHResult256 to the constructor should suffice. I looked but didn't find anything promising.

@lovell
Copy link
Owner

lovell commented Jan 7, 2018

Hello, the 128 and 256 bit hash functions were still under active upstream development until 4 days ago - see google/highwayhash@eeea446 - so we can now start to expose these.

PRs and thoughts/discussion about how to expose these are welcome.

@mceachen
Copy link
Author

mceachen commented Jan 7, 2018

Wow, I didn't know it was so recent, I had just assumed they'd have produced those variants initially.

I've seen both additional methods, as well as arguments, support this sort of a switch. Exposing new high-level functions (say, asString128() and asString256()) might be more discoverable than asString(key, input, bits), but the API is a bit cleaner to just add the optional third arg.

@lovell
Copy link
Owner

lovell commented Jan 10, 2018

Quick thought: perhaps we could use namespaced exports for this?

const { hh128 } = require('highwayhash');
hh128.asBuffer( ... );

@jan-wassenberg
Copy link

Wow, I didn't know it was so recent, I had just assumed they'd have produced those variants initially.

Hi @mceachen , FYI 128 and 256 bit variants have been around a long time but we hadn't yet frozen them until the change lovell mentioned.

@lovell
Copy link
Owner

lovell commented Jan 29, 2018

Commit a902c5f updates the HighwayHash source to latest so these improvements can now be exposed.

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

No branches or pull requests

3 participants