diff --git a/src/valuehash/impl.clj b/src/valuehash/impl.clj index 42e4888..ed839b5 100644 --- a/src/valuehash/impl.clj +++ b/src/valuehash/impl.clj @@ -1,6 +1,7 @@ (ns valuehash.impl "Simple implementation based on plain byte arrays" - (:import [java.util UUID Date])) + (:import [java.util UUID Date] + [java.math BigDecimal BigInteger])) (defprotocol CanonicalByteArray "An object that can be converted to a canonical byte array, with value @@ -64,6 +65,12 @@ (to-byte-array [this] (long->bytes (Double/doubleToLongBits this))) clojure.lang.Ratio (to-byte-array [this] (long->bytes (Double/doubleToLongBits (double this)))) + clojure.lang.BigInt + (to-byte-array [this] (long->bytes (Double/doubleToLongBits (double this)))) + BigInteger + (to-byte-array [this] (long->bytes (Double/doubleToLongBits (double this)))) + BigDecimal + (to-byte-array [this] (long->bytes (Double/doubleToLongBits (double this)))) Boolean (to-byte-array [this] (byte-array 1 (if this (byte 1) (byte 0)))) Character