NSData (EDExtensions)


Declared In:
NSData+Extensions.h


Category Description

Various common extensions to NSData.


Method Types

Calculating CRCs
- crc16
- crc32
Base64 encoding
- decodeBase64
- encodeBase64
- encodeBase64WithLineLength:andNewlineAtEnd:

Instance Methods

crc16

- (unsigned short)crc16

Returns the CRC16 for the receiver.


crc32

- (unsigned int)crc32

Returns the CRC32 for the receiver.


decodeBase64

- (NSData *)decodeBase64

Returns the data of which the receiver holds a base64 encoded version.


encodeBase64

- (NSData *)encodeBase64

Calls encodeBase64WithLineLength:andNewlineAtEnd: with 76 and YES as arguments.


encodeBase64WithLineLength:andNewlineAtEnd:

- (NSData *)encodeBase64WithLineLength:(unsigned int)lineLength andNewlineAtEnd:(BOOL)endWithNL

Returns the receiver in base64 encoding. This is useful when arbitrary binary data must be embedded into an ASCII format. See RFC2045 for details. Other encodings are handled in the EDMessage framework.

If lineLength is greater than 0, linebreaks are inserted after every lineLength characters. The last line might be shorter, of course, and a linebreak is only added if endWithNL is YES.


Version 2.1 Copyright ©2002. All Rights Reserved.