[CLJ-1336] Allow external collections to use standard collection hashing Created: 31/Jan/14 Updated: 14/Feb/14 Resolved: 14/Feb/14
|Affects Version/s:||Release 1.6|
|Fix Version/s:||Release 1.6|
|Reporter:||Alex Miller||Assignee:||Alex Miller|
|Attachments:||clj-1336-1.patch clj-1336-2.patch clj-1336-3.patch clj-1336-4.patch|
|Patch:||Code and Test|
With the change in new hashing algorithms in 1.6, we need to provide a public hook for collections implemented outside of core to participate in the same hash mixing behavior as core collections.
|Comment by Alex Miller [ 04/Feb/14 10:42 AM ]|
Updated patch for a couple issues. However, in testing the use of this I discovered that the hash-basis must be an int and the basis accumulation must be based on int-accumulation with int-overflow, so it is not possible to do this in pure Clojure so this function is not currently useful.
I think the best solution would be to provide functions that encapsulate the ordered and unordered algorithms (Murmur3/hashOrdered and Murmur3/hashUnordered basically) such that external collections can implement hasheq correctly and with good performance.
|Comment by Alex Miller [ 04/Feb/14 2:45 PM ]|
Add new patch that makes Murmur3 class public so it will work for users of mix-collection-hash. Also adds generative tests for comparing the external collection hashing algorithm with hashes produced by internal ordered and unordered collections. These tests currently fail due to