nicklockwood/GZIP

iOS GZIP value differs between iOS10 -> iOS11

Closed this issue · 1 comments

I just noticed through one of our tests that gzipped() data which is base64Encoded yields a different value between iOS10 vs iOS 11.

Anyone notice similar issues? I wouldn't have noticed had I not set my target to unit test with (iPhone 7, iOS 11). I was aware this could differ between 32/64 bit, but I was surprised by the different between iOS10 vs iOS11?

It also might be an issue that I shouldn't be testing this code in my app anyway?

Use Case:

        guard let JSON = try? JSONSerialization.data(withJSONObject: jsonObject, options: []), !validContacts.isEmpty,
            let gZippedData = (JSON as NSData).gzipped() else { return nil }

        return gZippedData.base64EncodedString(options: [])
XCTAssertEqual failed: XCTAssertEqual failed: ("Optional("H4sIAAAAAAAAA1WOOwvCMBRG/0q4cynNQ1OdWtBNRHAsHYKGGptHaaAg0v9uE43olOE759w0T5CwbeAqvJGjV7a7VZ0RSucXZ6DNQMEWOGQwBGqF14QSxikNk12mXfTQOYgwZ5+aVs5KXU3SGvcbKlOIMco5JbhkKXSICqr1JH0MBX6z8DEotcrv+SDHXln//8Eg77VCp/f4dXGRjpECE1ZSTnHi64foBTo6uzwwty+Dt4izBQEAAA==")") is not equal to ("Optional("H4sIAAAAAAAAE1WOOwvCMBRG/0q4cynNQ1OdWtBNRHAsHYKGGptHaaAg0v9uE43olOE759w0T5CwbeAqvJGjV7a7VZ0RSucXZ6DNQMEWOGQwBGqF14QSxikNk12mXfTQOYgwZ5+aVs5KXU3SGvcbKlOIMco5JbhkKXSICqr1JH0MBX6z8DEotcrv+SDHXln//8Eg77VCp/f4dXGRjpECE1ZSTnHi64foBTo6uzwwty+Dt4izBQEAAA==")") - 

Might be that Apple has bumped the libz framework version in iOS 11?