Latest 1.1.0
Homepage https://github.com/TapMesh/LZCompression
License Apache License, Version 2.0
Authors

An Objective-C implementation of lz-string for Javascript http://pieroxy.net/blog/pages/lz-string/index.html

Installation

Cocoapods

pod 'LZCompression'

Manual Installation

Add the NZString+LZCompression.h and NZString+LZCompression.m files to your project to use the new LZCompression category on NSString.

Usage

Text can be compressed to UTF16 only characters by using the compressLZToUTF16 method instead of the regular compressLZ method.

NSString *input = @"String that should be compressed";
NSString *lzCompressedInput = [input compressLZ];
NSString *lzCompressedInputBase64Coded = [input compressToBase64];
NSString *lzCompressedUTF16Input = [input compressLZToUTF16];

NSString *output = [lzCompressedInput decompressLZ];
NSString *outputFromCompressedBase64 = [lzCompressedInputBase64Coded decompressFromBase64];
NSString *outputFromUTF16 = [lzCompressedUTF16Input decompressLZFromUTF16];

Credits

A big thanks to Saumitra Bhave for implementing additional functionality from the original implementation.

Latest podspec

{
    "name": "LZCompression",
    "version": "1.1.0",
    "summary": "LZ-based compression algorithm for Objective-C.",
    "description": "An Objective-C implementation of lz-string for Javascript (see http://pieroxy.net/blog/pages/lz-string/index.html)",
    "homepage": "https://github.com/TapMesh/LZCompression",
    "license": "Apache License, Version 2.0",
    "authors": {
        "bobwieler": "[email protected]"
    },
    "source": {
        "git": "https://github.com/TapMesh/LZCompression.git",
        "tag": "1.1.0"
    },
    "source_files": [
        "Classes",
        "Classes/**/*.{h,m}"
    ],
    "exclude_files": "Classes/Exclude",
    "requires_arc": true
}

Pin It on Pinterest

Share This