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

Define API for 32 bit valued functions #1

Open
leventov opened this issue Oct 31, 2014 · 5 comments
Open

Define API for 32 bit valued functions #1

leventov opened this issue Oct 31, 2014 · 5 comments

Comments

@leventov
Copy link
Member

No description provided.

@peter-lawrey
Copy link
Member

Roman, can you provide more details?

@leventov
Copy link
Member Author

LongHashFunction returns longs as hash results. the idea is to provide something like IntHashFunction which return ints.

@peter-lawrey
Copy link
Member

Could you not do

long h64 = hash64(...);
int h32 = (int) ((h64 >>> 32) | h64);

@leventov
Copy link
Member Author

@peter-lawrey yes, currently people do this. But this looks like the library's job. In the simplest case IntLongFunction could do exactly this.

@pjakubik
Copy link

pjakubik commented Jul 30, 2023

Should that be

long h64 = hash64(...);
int h32 = (int) ((h64 >>> 32) ^ h64);

I think you want bitwise exclusive OR, not bitwise OR

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