Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luckymarmot/brotlikit
An Objective-C and Swift library for Brotli compression and decompression.
https://github.com/luckymarmot/brotlikit
brotli compression objective-c swift
Last synced: 3 months ago
JSON representation
An Objective-C and Swift library for Brotli compression and decompression.
- Host: GitHub
- URL: https://github.com/luckymarmot/brotlikit
- Owner: luckymarmot
- License: other
- Created: 2018-04-05T22:18:06.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-11T10:42:31.000Z (over 5 years ago)
- Last Synced: 2024-10-12T05:32:19.549Z (4 months ago)
- Topics: brotli, compression, objective-c, swift
- Language: Objective-C
- Size: 21.5 KB
- Stars: 13
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BrotliKit
An Objective-C and Swift library for Brotli compression and decompression.
## Installation
Via Cocoapods:
```
pod 'BrotliKit'
```## Usage
### `NSData` category
```objc
// compression
[myData compressBrotli];// decompression
[myData decompressBrotli];
```### Compressor class
Simple usage
```objc
// compression
[LMBrotliCompressor compressedDataWithData:myData];// decompression
[LMBrotliCompressor decompressedDataWithData:myData];
```Compression quality
```objc
// compression
[LMBrotliCompressor compressedDataWithData:myData quality:11];
```Decompressing partial inputs
```objc
// decompression
BOOL isPartialInput;
[LMBrotliCompressor decompressedDataWithData:myData isPartialInput:&isPartialInput];
```### Core Foundation API
```c
CF_EXPORT CFDataRef LMCreateBrotliCompressedData(const void* bytes, CFIndex length, int16_t quality);
CF_EXPORT CFDataRef LMCreateBrotliDecompressedData(const void* bytes, CFIndex length, bool* isPartialInput);
```## License
MIT License. The original [Brotli repository](https://github.com/google/brotli) is also under the MIT license.