-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Hi!
This is a question, and it could also be a bug. I have notice that the coercion of Sets invoke the digest function. However, the coercion of Maps does not. Why is it necessary for Sets but not for Maps? Could it lead to some weakness (collisions) in the hash of Maps?
clojure.lang.IPersistentMap
(-coerce [this md-create-fn write-handlers]
(if (record? this) ;; BUG somehow records can also trigger the map sometimes (?)
(let [{:keys [tag value]} (ib/incognito-writer write-handlers this)]
(encode (:literal magics) (coerce-seq [tag value] md-create-fn write-handlers)))
(encode (:map magics) (xor-hashes (map #(-coerce % md-create-fn write-handlers) (seq this))))))
clojure.lang.IPersistentSet
(-coerce [this md-create-fn write-handlers]
(encode (:set magics) (xor-hashes (map #(digest (-coerce % md-create-fn write-handlers)
md-create-fn)
(seq this)))))Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels