Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stremovskyy/swiftydeflate
A Swift package that offers simple compression (deflate) and decompression (inflate) functionalities built on top of zlib.
https://github.com/stremovskyy/swiftydeflate
deflate deflate-compression library package swift
Last synced: 4 days ago
JSON representation
A Swift package that offers simple compression (deflate) and decompression (inflate) functionalities built on top of zlib.
- Host: GitHub
- URL: https://github.com/stremovskyy/swiftydeflate
- Owner: stremovskyy
- License: mit
- Created: 2023-09-22T13:14:06.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-23T20:33:04.000Z (about 1 year ago)
- Last Synced: 2024-04-17T15:43:32.056Z (7 months ago)
- Topics: deflate, deflate-compression, library, package, swift
- Language: Swift
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SwiftyDeflate
A Swift package that offers simple compression (deflate) and decompression (inflate) functionalities built on top of zlib.
![Swift](https://img.shields.io/badge/Swift-5.3-orange.svg)
![Platforms](https://img.shields.io/badge/platforms-macOS%20%7C%20iOS%20%7C%20watchOS%20%7C%20tvOS-lightgrey.svg)## Features
- [x] Compression using `deflate`
- [x] Decompression using `inflate`
- [x] Customizable compression levels
- [x] Seamless integration with `Data` type in Swift## Installation
### Swift Package Manager
Add the following line to the dependencies in your `Package.swift` file:
```swift
.package(url: "https://github.com/stremovskyy/SwiftyDeflate.git", from: "1.0.0")
```## Usage
### Deflate (Compression)
```swift
do {
let originalData: Data = ... // Your data
let compressedData = try originalData.deflateCompress()
// Use compressedData
} catch {
print("Error during compression: \(error.localizedDescription)")
}
```### Inflate (Decompression)
```swift
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.