https://github.com/luckymarmot/zstdkit
An Objective-C and Swift library for Zstd (Zstandard) compression and decompression.
https://github.com/luckymarmot/zstdkit
compression objective-c swift zstandard zstd
Last synced: 10 months ago
JSON representation
An Objective-C and Swift library for Zstd (Zstandard) compression and decompression.
- Host: GitHub
- URL: https://github.com/luckymarmot/zstdkit
- Owner: luckymarmot
- License: other
- Created: 2018-04-12T21:03:34.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-11T19:25:09.000Z (almost 3 years ago)
- Last Synced: 2025-04-11T02:09:29.748Z (10 months ago)
- Topics: compression, objective-c, swift, zstandard, zstd
- Language: Objective-C
- Size: 14.6 KB
- Stars: 27
- Watchers: 2
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ZstdKit
An Objective-C and Swift library for Zstd (Zstandard) compression and decompression.
## Installation
Via Cocoapods:
```
pod 'ZstdKit'
```
## Usage
### `NSData` category
```objc
// compression
[myData compressZstd];
// decompression
[myData decompressZstd];
```
### Compressor class
Simple usage
```objc
// compression
[LMZstdCompressor compressedDataWithData:myData];
// decompression
[LMZstdCompressor decompressedDataWithData:myData];
```
Compression level
```objc
// compression
[LMZstdCompressor compressedDataWithData:myData compressionLevel:3];
```
### Core Foundation API
```c
CF_EXPORT CFDataRef LMCreateZstdCompressedData(const void* bytes, CFIndex length, int16_t compressionLevel);
CF_EXPORT CFDataRef LMCreateZstdDecompressedData(const void* bytes, CFIndex length);
```
## License
The original [Zstandard code](https://github.com/facebook/zstd) is licensed under the [BSD license](https://github.com/facebook/zstd/blob/dev/LICENSE). This code is licensed under the MIT license.