 
 ;; ## Long Lexicoder
 
+; TODO: use prefix length encoding, otherwise simple values like 0 double in size when escaped.
 (defrecord LongLexicoder
   []
 


  (encode*
    [_ value]
    (let [encoded (encode* coder value)
          rdata (byte-array (alength encoded))]
      (dotimes [i (alength encoded)]
        (aset-byte rdata i (flip-byte (aget encoded i))))

                 (as-> b (if (neg? b) (+ b 256) b))
                 (bit-shift-left (- 56 (* i 8)))
                 (+ value)))
        ; Unflip sign bit.
        (bit-xor value Long/MIN_VALUE)))))


