rust-farmhash icon indicating copy to clipboard operation
rust-farmhash copied to clipboard

Why can hash value vary by library version and platform?

Open rigdent opened this issue 8 years ago • 1 comments

Hello,

I was wondering why it is the case that the "hash value may vary with library version and platform" as written in the API docs for the hash32() function? I looked at that function, and it just seems to be a bunch of operations (bit shift, mult, rotate, etc) being done on the item being hashed, but none of that should be platform specific. So why is the hash value not deterministic?

Thanks

rigdent avatar Jul 03 '17 18:07 rigdent

@rigdent on certain platforms vector shift and rotate can be endian-sensitive. See: https://stackoverflow.com/a/7184905/1080804

evbo avatar Jul 17 '23 14:07 evbo