Skip to content

An Objective-C and Swift library for Brotli compression and decompression.

License

Notifications You must be signed in to change notification settings

luckymarmot/BrotliKit

Repository files navigation

BrotliKit

An Objective-C and Swift library for Brotli compression and decompression.

Installation

Via Cocoapods:

pod 'BrotliKit'

Usage

NSData category

// compression
[myData compressBrotli];

// decompression
[myData decompressBrotli];

Compressor class

Simple usage

// compression
[LMBrotliCompressor compressedDataWithData:myData];

// decompression
[LMBrotliCompressor decompressedDataWithData:myData];

Compression quality

// compression
[LMBrotliCompressor compressedDataWithData:myData quality:11];

Decompressing partial inputs

// decompression
BOOL isPartialInput;
[LMBrotliCompressor decompressedDataWithData:myData isPartialInput:&isPartialInput];

Core Foundation API

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 is also under the MIT license.

About

An Objective-C and Swift library for Brotli compression and decompression.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published