Added README section on adding files with encryption.

Improved support for CRC32 calculation.
Bumped version to 1.0.5
This commit is contained in:
Gianluca Bertani
2017-05-21 10:29:59 +02:00
parent e136e27380
commit ed43028b8d
33 changed files with 123 additions and 65 deletions

View File

@@ -1,6 +1,6 @@
//
// Objective-Zip_Swift_Tests.swift
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 20/09/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// ObjectiveZip_Tests.m
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 29/08/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -139,16 +139,16 @@
/* Begin PBXFileReference section */
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
8C14E8181773A09F00B84597 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
8C1D598C1771057D006D69C3 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = "<group>"; };
8C1D598C1771057D006D69C3 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; lineEnding = 0; path = README.md; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.markdown; };
8C33B2C01EC6F0CD00F49381 /* crypt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crypt.c; sourceTree = "<group>"; };
8C33B2C31EC6F50400F49381 /* NSDate+DOSDate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSDate+DOSDate.h"; sourceTree = "<group>"; };
8C33B2C41EC6F9AD00F49381 /* NSDate+DOSDate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+DOSDate.m"; sourceTree = "<group>"; };
8C33B2C91EC7441A00F49381 /* NSData+CRC32.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSData+CRC32.h"; sourceTree = "<group>"; };
8C33B2CA1EC7443200F49381 /* NSData+CRC32.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+CRC32.m"; sourceTree = "<group>"; };
8C33B2C31EC6F50400F49381 /* NSDate+DOSDate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "NSDate+DOSDate.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C33B2C41EC6F9AD00F49381 /* NSDate+DOSDate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = "NSDate+DOSDate.m"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
8C33B2C91EC7441A00F49381 /* NSData+CRC32.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "NSData+CRC32.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C33B2CA1EC7443200F49381 /* NSData+CRC32.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = "NSData+CRC32.m"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
8C33B2D01EC747A800F49381 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
8C59F37F1BAEE3BB00DBB3D0 /* Objective-Zip Tests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Objective-Zip Tests-Bridging-Header.h"; sourceTree = "<group>"; };
8C59F3801BAEE3BB00DBB3D0 /* Objective-Zip OS X Tests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Objective-Zip OS X Tests-Bridging-Header.h"; sourceTree = "<group>"; };
8C59F3811BAEE3BC00DBB3D0 /* Objective-Zip_Swift_Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Objective-Zip_Swift_Tests.swift"; sourceTree = "<group>"; };
8C59F3811BAEE3BC00DBB3D0 /* Objective-Zip_Swift_Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "Objective-Zip_Swift_Tests.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
8C59F3841BAEE48600DBB3D0 /* adler32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = adler32.c; sourceTree = "<group>"; };
8C59F3851BAEE48600DBB3D0 /* compress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = compress.c; sourceTree = "<group>"; };
8C59F3861BAEE48600DBB3D0 /* crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crc32.c; sourceTree = "<group>"; };
@@ -182,36 +182,36 @@
8C59F3CB1BAEE49400DBB3D0 /* unzip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unzip.h; sourceTree = "<group>"; };
8C59F3CC1BAEE49400DBB3D0 /* zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip.c; sourceTree = "<group>"; };
8C59F3CD1BAEE49400DBB3D0 /* zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zip.h; sourceTree = "<group>"; };
8C59F3D81BAEE4A100DBB3D0 /* Objective-Zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Objective-Zip.h"; sourceTree = "<group>"; };
8C59F3D91BAEE4A100DBB3D0 /* Objective-Zip+NSError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Objective-Zip+NSError.h"; sourceTree = "<group>"; };
8C59F3DA1BAEE4A100DBB3D0 /* OZFileInZipInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OZFileInZipInfo.h; sourceTree = "<group>"; };
8C59F3DB1BAEE4A100DBB3D0 /* OZFileInZipInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OZFileInZipInfo.m; sourceTree = "<group>"; };
8C59F3DC1BAEE4A100DBB3D0 /* OZFileInZipInfo+Internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OZFileInZipInfo+Internals.h"; sourceTree = "<group>"; };
8C59F3DD1BAEE4A100DBB3D0 /* OZZipCompressionLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OZZipCompressionLevel.h; sourceTree = "<group>"; };
8C59F3DE1BAEE4A100DBB3D0 /* OZZipException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OZZipException.h; sourceTree = "<group>"; };
8C59F3DF1BAEE4A100DBB3D0 /* OZZipException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OZZipException.m; sourceTree = "<group>"; };
8C59F3E01BAEE4A100DBB3D0 /* OZZipException+Internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OZZipException+Internals.h"; sourceTree = "<group>"; };
8C59F3E11BAEE4A100DBB3D0 /* OZZipFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OZZipFile.h; sourceTree = "<group>"; };
8C59F3E21BAEE4A100DBB3D0 /* OZZipFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OZZipFile.m; sourceTree = "<group>"; };
8C59F3E31BAEE4A100DBB3D0 /* OZZipFile+NSError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OZZipFile+NSError.h"; sourceTree = "<group>"; };
8C59F3E41BAEE4A100DBB3D0 /* OZZipFile+Standard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OZZipFile+Standard.h"; sourceTree = "<group>"; };
8C59F3E51BAEE4A100DBB3D0 /* OZZipFileMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OZZipFileMode.h; sourceTree = "<group>"; };
8C59F3E61BAEE4A100DBB3D0 /* OZZipReadStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OZZipReadStream.h; sourceTree = "<group>"; };
8C59F3E71BAEE4A100DBB3D0 /* OZZipReadStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OZZipReadStream.m; sourceTree = "<group>"; };
8C59F3E81BAEE4A100DBB3D0 /* OZZipReadStream+Internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OZZipReadStream+Internals.h"; sourceTree = "<group>"; };
8C59F3E91BAEE4A100DBB3D0 /* OZZipReadStream+NSError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OZZipReadStream+NSError.h"; sourceTree = "<group>"; };
8C59F3EA1BAEE4A100DBB3D0 /* OZZipReadStream+Standard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OZZipReadStream+Standard.h"; sourceTree = "<group>"; };
8C59F3EB1BAEE4A100DBB3D0 /* OZZipWriteStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OZZipWriteStream.h; sourceTree = "<group>"; };
8C59F3EC1BAEE4A100DBB3D0 /* OZZipWriteStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OZZipWriteStream.m; sourceTree = "<group>"; };
8C59F3ED1BAEE4A100DBB3D0 /* OZZipWriteStream+Internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OZZipWriteStream+Internals.h"; sourceTree = "<group>"; };
8C59F3EE1BAEE4A100DBB3D0 /* OZZipWriteStream+NSError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OZZipWriteStream+NSError.h"; sourceTree = "<group>"; };
8C59F3EF1BAEE4A100DBB3D0 /* OZZipWriteStream+Standard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OZZipWriteStream+Standard.h"; sourceTree = "<group>"; };
8C59F3D81BAEE4A100DBB3D0 /* Objective-Zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "Objective-Zip.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3D91BAEE4A100DBB3D0 /* Objective-Zip+NSError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "Objective-Zip+NSError.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3DA1BAEE4A100DBB3D0 /* OZFileInZipInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = OZFileInZipInfo.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3DB1BAEE4A100DBB3D0 /* OZFileInZipInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = OZFileInZipInfo.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
8C59F3DC1BAEE4A100DBB3D0 /* OZFileInZipInfo+Internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "OZFileInZipInfo+Internals.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3DD1BAEE4A100DBB3D0 /* OZZipCompressionLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = OZZipCompressionLevel.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3DE1BAEE4A100DBB3D0 /* OZZipException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = OZZipException.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3DF1BAEE4A100DBB3D0 /* OZZipException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = OZZipException.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
8C59F3E01BAEE4A100DBB3D0 /* OZZipException+Internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "OZZipException+Internals.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3E11BAEE4A100DBB3D0 /* OZZipFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = OZZipFile.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3E21BAEE4A100DBB3D0 /* OZZipFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = OZZipFile.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
8C59F3E31BAEE4A100DBB3D0 /* OZZipFile+NSError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "OZZipFile+NSError.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3E41BAEE4A100DBB3D0 /* OZZipFile+Standard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "OZZipFile+Standard.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3E51BAEE4A100DBB3D0 /* OZZipFileMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = OZZipFileMode.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3E61BAEE4A100DBB3D0 /* OZZipReadStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = OZZipReadStream.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3E71BAEE4A100DBB3D0 /* OZZipReadStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = OZZipReadStream.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
8C59F3E81BAEE4A100DBB3D0 /* OZZipReadStream+Internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "OZZipReadStream+Internals.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3E91BAEE4A100DBB3D0 /* OZZipReadStream+NSError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "OZZipReadStream+NSError.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3EA1BAEE4A100DBB3D0 /* OZZipReadStream+Standard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "OZZipReadStream+Standard.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3EB1BAEE4A100DBB3D0 /* OZZipWriteStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = OZZipWriteStream.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3EC1BAEE4A100DBB3D0 /* OZZipWriteStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = OZZipWriteStream.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
8C59F3ED1BAEE4A100DBB3D0 /* OZZipWriteStream+Internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "OZZipWriteStream+Internals.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3EE1BAEE4A100DBB3D0 /* OZZipWriteStream+NSError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "OZZipWriteStream+NSError.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8C59F3EF1BAEE4A100DBB3D0 /* OZZipWriteStream+Standard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "OZZipWriteStream+Standard.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
8CC2FC581B91E63E00D5E05F /* libObjective-Zip.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libObjective-Zip.a"; sourceTree = BUILT_PRODUCTS_DIR; };
8CC2FC621B91E63E00D5E05F /* Objective-Zip Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Objective-Zip Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
8CC2FC681B91E63E00D5E05F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8CC2FC731B91E65200D5E05F /* libObjective-Zip_OS_X.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libObjective-Zip_OS_X.a"; sourceTree = BUILT_PRODUCTS_DIR; };
8CC2FC7D1B91E65200D5E05F /* Objective-Zip OS X Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Objective-Zip OS X Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
8CC2FCB81B91EB3500D5E05F /* ObjectiveZip_Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ObjectiveZip_Tests.m; path = "Objective-Zip Tests/ObjectiveZip_Tests.m"; sourceTree = SOURCE_ROOT; };
8CC2FCB81B91EB3500D5E05F /* ObjectiveZip_Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = ObjectiveZip_Tests.m; path = "Objective-Zip Tests/ObjectiveZip_Tests.m"; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */

View File

@@ -1,6 +1,6 @@
//
// NSData+CRC32.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 13/05/2017.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.
@@ -41,6 +41,7 @@
#pragma mark Handy CRC32 computation
- (uint32_t) crc32;
- (uint32_t) crc32withInitialCrc32:(uint32_t)initialCrc32;
@end

View File

@@ -1,6 +1,6 @@
//
// NSData+CRC32.m
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 13/05/2017.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.
@@ -47,7 +47,11 @@ unsigned long crc32(unsigned long crc, const unsigned char *buf, unsigned int le
#pragma mark Handy CRC32 computation
- (uint32_t) crc32 {
return (uint32_t) crc32(0, [self bytes], (unsigned int) [self length]);
return [self crc32withInitialCrc32:0];
}
- (uint32_t) crc32withInitialCrc32:(uint32_t)initialCrc32 {
return (uint32_t) crc32(initialCrc32, [self bytes], (unsigned int) [self length]);
}

View File

@@ -1,6 +1,6 @@
//
// NSDate+DOSDate.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 13/05/2017.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// NSDate+DOSDate.m
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 13/05/2017.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZFileInZipInfo+Internals.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 27/08/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZFileInZipInfo.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 27/12/09.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZFileInZipInfo.m
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 27/12/09.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipCompressionLevel.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 27/08/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipException+Internals.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 27/08/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipException.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 25/12/09.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipException.m
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 25/12/09.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipFile+NSError.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 09/09/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipFile+Standard.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 09/09/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipFile.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 25/12/09.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipFile.m
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 25/12/09.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipFileMode.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 27/08/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipReadStream+Internals.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 27/08/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipReadStream+NSError.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 09/09/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipReadStream+Standard.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 09/09/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipReadStream.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 28/12/09.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipReadStream.m
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 28/12/09.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipWriteStream+Internals.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 27/08/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipWriteStream+NSError.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 09/09/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipWriteStream+Standard.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 09/09/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipWriteStream.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 25/12/09.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// OZZipWriteStream.m
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 25/12/09.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// Objective-Zip+NSError.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 09/09/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// Objective-Zip.h
// Objective-Zip v. 1.0.4
// Objective-Zip v. 1.0.5
//
// Created by Gianluca Bertani on 27/08/15.
// Copyright 2009-2017 Gianluca Bertani. All rights reserved.

View File

@@ -98,6 +98,55 @@ OZZipWriteStream *stream= [zipFile writeFileInZipWithName:@"abc.txt"
```
Adding a file to a zip file using encryption
--------------------------------------------
Objective-Zip supports only traditional PKWare encryption, which is also the
format most widely supported by common unzip utilities.
To add a file with encryption, it is necessary to precompute a CRC32 of
the file being added. This is needed by traditional PKWare encryption
to later verify that the password provided for decryption is correct.
The library includes a handy crc32 method as an NSData category
(automatically imported under the umbrella header):
```objective-c
NSData *fileData= // Your file data
uint32_t crc= [fileData crc32];
OZZipWriteStream *stream= [zipFile writeFileInZipWithName:@"abc.txt"
compressionLevel:OZZipCompressionLevelBest
password:@"password"
crc32:crc];
[stream writeData:fileData];
[stream finishedWriting];
```
Note that passing 0 (or any other non-CRC32 number) as the crc32 argument will make
the decryption fail, even if the correct password is specified.
Note also that if your file is too large to be stored in a single NSData, you
can still compute the CRC32 progressively by using a loop:
```objective-c
NSFileHandle *fileHandle= // Your file handle
uint32_t crc= 0;
do {
// Read a chunk of the file in data buffer
NSData *data= [fileHandle readDataOfLength:BUFFER_SIZE];
if ([data length] == 0)
break;
crc= [data crc32withInitialCrc32:crc];
} while (YES);
```
Reading a file from a zip file
------------------------------
@@ -279,6 +328,10 @@ The library is distributed under the New BSD License.
Version history
===============
Version 1.0.5:
- Improved support for computation of CRC32
Version 1.0.4:
- Updated to latest version of MiniZip (as of 13/5/2017)
@@ -363,7 +416,7 @@ Version 0.7.0:
Compatibility
=============
Version 1.0.3 has been tested with iOS up to 10.3 and OS X up to 10.12, but
should be compatible with earlier versions too, down to iOS 8.9 and OS X 10.7.
Version 1.0.5 has been tested with iOS up to 10.3 and OS X up to 10.12, but
should be compatible with earlier versions too, down to iOS 8.0 and OS X 10.7.
Le me know of any issues that should arise.

View File

@@ -3,7 +3,7 @@ Pod::Spec.new do |s|
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.name = "objective-zip"
s.version = "1.0.4"
s.version = "1.0.5"
s.summary = "An object-oriented friendly wrapper library for ZLib and MiniZip, in Objective-C for iOS and OS X"
s.description = <<-DESC