I have julia objects and want to hash them such that:
- If two objects are equal, then their hashes are equal. The other way round is also true with overwhelming probability.
- The hash should not change across sessions. E.g. hashing an object, saving to jld, rebooting, loading, hashing yields the same answer.
- Ideally this would work for objects of arbitrary type, but I guess that’s an endless rabbit hole. So I am happy if it works for bitstypes, Strings, Symbols and immutables build up of these.
What is a reasonable way to achieve this? Is there maybe some package? The
hash function in base seems to be inconsistent across sessions.