Latest 0.1.1
License Apache License, Version 2.0
Platforms ios 4.3

[CI Status]( Bigland/NIXTextEncoding)


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.


iOS 6.0+


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

pod "NIXTextEncoding"


Adrian Bigland, [email protected]


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": "",
    "license": "Apache License, Version 2.0",
    "authors": {
        "Adrian David Bigland": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.1"
    "social_media_url": "",
    "platforms": {
        "ios": "4.3"
    "requires_arc": false,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "NIXTextEncoding": [

Pin It on Pinterest

Share This