Zero-Allocation-Hashing
Zero-Allocation-Hashing copied to clipboard
Define API for 32 bit valued functions
Roman, can you provide more details?
LongHashFunction
returns long
s as hash results. the idea is to provide something like IntHashFunction
which return int
s.
Could you not do
long h64 = hash64(...);
int h32 = (int) ((h64 >>> 32) | h64);
@peter-lawrey yes, currently people do this. But this looks like the library's job. In the simplest case IntLongFunction
could do exactly this.
Should that be
long h64 = hash64(...);
int h32 = (int) ((h64 >>> 32) ^ h64);
I think you want bitwise exclusive OR, not bitwise OR