   (update-digest! [this data offset length]
     (.update this ^"[B" data offset length))
   (read-digest! [this]
-    (let [v (int (.getValue this))]
-      (-> (ByteBuffer/allocate 4)
-        (.putInt v)
-        (.array))))
+    (long->4-bytes (.getValue this)))
   (byte-digest [this data]
     (doto this
       (reset-digest!)

      :author "Yannick Scherer"}
  pandect.checksum
  (:use pandect.hashable)
  (:import [java.util.zip Adler32 CRC32]
           [java.nio ByteBuffer]))

(set! *warn-on-reflection* true)
(set! *unchecked-math* true)

;; ## Adler32


  (update-digest! [this data offset length]
    (.update this ^"[B" data offset length))
  (read-digest! [this]
    (long->4-bytes (.getValue this)))
  (byte-digest [this data]
    (doto this
      (reset-digest!)
