GzipSwift is a framework with an extension of Data written in Swift. It enables compress/decompress gzip using zlib.
Usage
import Gzip
// gzip
let compressedData: Data = try! data.gzipped()
let optimizedData: Data = try! data.gzipped(level: .bestCompression)
// gunzip
let decompressedData: Data
if data.isGzipped {
decompressedData = try! data.gunzipped()
} else {
decompressedData = data
}
Installation
GzipSwift is SwiftPM-compatible. To install, add this package to your Package.swift or your Xcode project.
GzipSwift
GzipSwift is a framework with an extension of Data written in Swift. It enables compress/decompress gzip using zlib.
Usage
Installation
GzipSwift is SwiftPM-compatible. To install, add this package to your
Package.swift
or your Xcode project.For Linux
Install zlib if you haven’t installed yet:
Add this package to your package.swift.
If Swift build failed with a linker error:
swift build
License
© 2014-2023 1024jp
GzipSwift is distributed under the terms of the MIT License. See LICENSE for details.