Skip to content

A Swift package that offers simple compression (deflate) and decompression (inflate) functionalities built on top of zlib.

License

Notifications You must be signed in to change notification settings

stremovskyy/SwiftyDeflate

Repository files navigation

SwiftyDeflate

A Swift package that offers simple compression (deflate) and decompression (inflate) functionalities built on top of zlib.

Swift Platforms

Features

  • Compression using deflate
  • Decompression using inflate
  • Customizable compression levels
  • Seamless integration with Data type in Swift

Installation

Swift Package Manager

Add the following line to the dependencies in your Package.swift file:

.package(url: "https://github.com/stremovskyy/SwiftyDeflate.git", from: "1.0.0")

Usage

Deflate (Compression)

do {
    let originalData: Data = ... // Your data
    let compressedData = try originalData.deflateCompress()
    // Use compressedData
} catch {
    print("Error during compression: \(error.localizedDescription)")
}

Inflate (Decompression)

do {
    let compressedData: Data = ... // Your compressed data
    let decompressedData = try compressedData.deflateDecompress()
    // Use decompressedData
} catch {
    print("Error during decompression: \(error.localizedDescription)")
}

Requirements

  • Swift 5.3+
  • macOS, iOS, watchOS, tvOS

Contributing

Contributions are very welcome! Please submit a pull request or create an issue to share your improvements or report bugs.

License

SwiftyDeflate is released under the MIT License. See LICENSE for details.

About

A Swift package that offers simple compression (deflate) and decompression (inflate) functionalities built on top of zlib.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages