         return CBOR.encodeDate(self)
     }
 }
+
+extension Data: CBOREncodable {
+    public func encode() -> [UInt8] {
+        return CBOR.encodeByteString(self.map{ $0 })
+    }
+}
 #endif

    }
}


extension Bool: CBOREncodable {
    public func encode() -> [UInt8] {
        return CBOR.encodeBool(self)

import Foundation
#endif

public protocol CBOREncodable: Hashable {
    func encode() -> [UInt8]
}

