Closed rljacobson closed 2 years ago
Hi Robert,
The prefixes are indeed chosen randomly. I do believe the original intent was, as you suspect, to avoid collisions of data being hashed for different types. For example, if a String happened to have the same text as a Symbol, this allows it to hash to a different value. I don't remember why exactly I chose 8 bytes to do this instead of 1. Eight seems like overkill right now. That's what I remember.
Thanks, Cory! I hope you are doing well.
Hi Cory,
I notice you are feeding in a different 8 byte prefix to the fnv hash function before hashing the data for each atom type. This method for
String
is typical:What's the significance of this prefix? Are you just avoiding collisions in case of coincidental equality of data being hashed for different types? Are your choices of prefix chosen randomly?