Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
Perform compositional hashing of data (for hash table for example) combining hash of simple data using the XOR operation.
Although the function hash_jenkins() does the same, it is not recommended to use it as is on custom classes. Depending on the type of attributes, padding bytes may be inserted and not initialized. When the hash_jenkins is called on such an object, this padding bytes will be involved in the hash and therefore, two equal objects (from the logicial point of view of the application) may produce a different hash values.
Instead, the best approach is to propose your own hash function and to use this object as an accumulator of the field hash as below: