             data.append(&value, length: 1)
             i = index(i, offsetBy: 2, limitedBy: utf16.endIndex)!
         }
-        return data
+        return data as Data
     }
 }
 


//  https://codereview.stackexchange.com/questions/135424/hex-string-to-bytes-nsdata?newreg=06dfe1d5b9964b928631538c9e48d421
extension String {
    func dataFromHexString() -> NSData? {

        // Convert 0 ... 9, a ... f, A ...F to their decimal value,
        // return nil for all other input characters

        }

        let utf16 = self.utf16
        guard let data = NSMutableData(capacity: utf16.count/2) else { return nil }

        var i = utf16.startIndex
        while i != utf16.endIndex {
