 
 func isBigEndianFromMandatoryByteOrderFirstCharacter(_ format:String) -> Bool {
     
-    guard let firstChar = format.characters.first else { assertionFailure("empty format"); return false }
+    guard let firstChar = format.first else { assertionFailure("empty format"); return false }
     
     let s = NSString(string: String(firstChar))
     let c = s.substring(to: 1)

                }
                bytes = data.bytes
            case "b":
                bytes = Int8(truncatingBitPattern:o as! Int).data.bytes
            case "h":
                bytes = Int16(truncatingBitPattern:o as! Int).data.bytes
            case "i", "l":
                bytes = Int32(truncatingBitPattern:o as! Int).data.bytes
            case "q", "Q":
                bytes = Int64(o as! Int).data.bytes
            case "B":
                bytes = UInt8(truncatingBitPattern:o as! Int).data.bytes
            case "H":
                bytes = UInt16(truncatingBitPattern:o as! Int).data.bytes
            case "I", "L":
                bytes = UInt32(truncatingBitPattern:o as! Int).data.bytes
            case "f":
                bytes = Float32(o as! Double).data.bytes
            case "d":

        return nil
    }
    
    var data = Data(capacity: s.count / 2)
    
    for i in stride(from: 0, to:s.count, by:2) {
        let byteString = s[i, i+2]
        let byte = UInt8(byteString.withCString { strtoul($0, nil, 16) })
        data.append([byte] as [UInt8], count: 1)
