Latest 0.1.1
Homepage https://github.com/adrian-db/NIXTextEncoding
License Apache License, Version 2.0
Platforms ios 4.3
Authors

[CI Status](https://travis-ci.org/Adrian Bigland/NIXTextEncoding)
Version
License
Platform

Usage

This provides a category on NSData for encoding and decoding data as base 64 strings.

Import the category:

#import <NIXTextEncoding/NSData+Base64.h>

Encoding data as a string:

NSData *myData = [self createDataInYourApp];
NSString *base64String = [myData nixEncodeBase64String];

Decoding a string back into data:

NSData *data = [NSData nixDecodeBase64String:base64String];

The tests provide more examples if you need them.

What is Base 64 encoding?

Base 64 encoding is a technique for expressing binary information (a sequence of bits) such as the coloured dots in a digital image, or the machine code of a computer program using just the letters of the alphabet, and digits 0 to 9 (and ‘+’, ‘-‘ and ‘=’ too!).

You would use this technique to pass binary data through a system used mainly for text – like e-mail – to make sure the more exotic patterns of bits in the original binary are not mangled in the process. Sometimes binary data needs printing out, and turning it into text is useful then – printers may not be able to handle non-alphanumeric characters. It also helps to have it in textual form for entry back into a computer later.

The downside is that the textual form has about a third more bytes than the original binary, and some processing is needed, which may have performance repercussions – although it is pretty lightweight.

Refer to the Wikipedia article and the definition in RFC 4648 for greater detail.

Requirements

iOS 6.0+

Installation

NIXTextEncoding is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "NIXTextEncoding"

Author

Adrian Bigland, [email protected]

License

NIXTextEncoding is available under the Version 2.0 Apache License. See the LICENSE file for more info.

Latest podspec

{
    "name": "NIXTextEncoding",
    "version": "0.1.1",
    "summary": "Implements the Base64 encoding and decoding described in RFC 4748.",
    "homepage": "https://github.com/adrian-db/NIXTextEncoding",
    "license": "Apache License, Version 2.0",
    "authors": {
        "Adrian David Bigland": "[email protected]"
    },
    "source": {
        "git": "https://github.com/adrian-db/NIXTextEncoding.git",
        "tag": "0.1.1"
    },
    "social_media_url": "https://twitter.com/adrian_bigland",
    "platforms": {
        "ios": "4.3"
    },
    "requires_arc": false,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "NIXTextEncoding": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This