Go to file
1024jp 731037f6cc Upate CHANGELOG 2023-06-16 13:11:55 +09:00
.github Update timing to run CodeQL 2023-05-01 17:19:49 +09:00
Sources Add more Sendable 2023-06-14 07:47:19 +09:00
Tests/GzipTests Refactor tests 2023-04-29 15:54:47 +09:00
.gitignore Remove lines for CocoaPods in .gitignore 2019-10-23 13:38:12 +09:00
.swiftlint.yml Style code 2023-04-29 17:41:36 +09:00
CHANGELOG.md Upate CHANGELOG 2023-06-16 13:11:55 +09:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2023-05-01 18:42:37 +09:00
LICENSE Update CHANGELOG 2023-04-29 13:26:46 +09:00
Package.swift Style code 2023-04-29 17:41:36 +09:00
README.md Update README 2023-04-29 14:02:25 +09:00

README.md

GzipSwift

platform CI Status SwiftPM-compatible

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.

dependencies: [
    .package(name: "Gzip", url: "https://github.com/1024jp/GzipSwift", from: Version(6, 0, 0)),
],

For Linux

  1. Install zlib if you haven't installed yet:

    $ apt-get install zlib-dev
    
  2. Add this package to your package.swift.

  3. If Swift build failed with a linker error:

    • check if libz.so is in your /usr/local/lib
      • if no, reinstall zlib as step (1)
      • if yes, link the library manually by passing '-Xlinker -L/usr/local/lib' with swift build

License

© 2014-2023 1024jp

GzipSwift is distributed under the terms of the MIT License. See LICENSE for details.