Skip to content

Commit

Permalink
Fix null in seq bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Weilbach committed Sep 6, 2016
1 parent 070e915 commit c25b111
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -182,6 +182,7 @@ nil


# Changes
- 0.3.1 fix bug in hashing sequences containing null
- 0.3.0 fix accidental hashing of records as maps
- 0.3.0-beta4 fix record serialization with incognito
- 0.3.0 Overhaul encoding for ~10x-20x times performance on the JVM. Use safe SHA-512. Add byte-array support for blobs.
Expand Down
6 changes: 3 additions & 3 deletions src/hasch/benc.cljc
Expand Up @@ -43,9 +43,9 @@
(defn ^bytes coerce-seq [seq md-create-fn write-handlers]
(let [^MessageDigest seq-md (md-create-fn)]
(loop [s seq]
(let [f (first s)]
(when f
(.update seq-md ^bytes (-coerce f md-create-fn write-handlers))
(let [[f & r] s]
(.update seq-md ^bytes (-coerce f md-create-fn write-handlers))
(when-not (empty? r)
(recur (rest s)))))
(.digest seq-md)))

Expand Down

0 comments on commit c25b111

Please sign in to comment.