         }
         return array
     }
-
 }

    Provides the data as an array of UInt8 bytes for easy manipulation.
     */
    public var bytesArray: [UInt8] {
        return toBytesArray()
    }

    private func toBytesArray() -> [UInt8] {
        let count = self.count / MemoryLayout<UInt8>.stride
        let array = self.withUnsafeBytes { (bytes: UnsafePointer<UInt8>) -> [UInt8] in
            var byteArray = [UInt8]()

     */
    public init?(hexString: String) {
        let noSpaces = hexString.replacingOccurrences(of: "\\s", with: "", options: .regularExpression, range: nil)
        guard noSpaces.count % 2 == 0 else {
            return nil
        }
        let hexArray = noSpaces.split(intoChunksOf: 2)

        var byteArray = [UInt8]()
        byteArray.reserveCapacity(hexString.count)
        for substringByte in hexArray {
            guard substringByte != "0x" else {
                continue
            }
            guard let byte = UInt8(substringByte, radix: 16) else {
                return nil
            }
            byteArray.append(byte)
        }
        self = Data(bytes: byteArray)
