Best way to uniquely hash an array of undefined length?
I need to recursively hash a tree of arrays/dicts, is there a preferred/best way to hash the values quickly?
Essentially I need to cache equality, the idea being to hash every array in the tree once and lookup the object pointer, otherwise I'd have to generate the hash many times when comparing the arrays.
If there's a better way to achieve that entirely, I'm open to that too.
4 Replies
(The array is an array of arrays, the arrays hash will be made up of the contained arrays hashes)
Would something like this work?
I hope it's never reached, but the length will never exceed 16,777,215 (
UInt24
)HashCode Struct (System)
Combines the hash code for multiple values into a single hash code.
@Arch Leaders
Thanks