https://github.com/chris-huxtable/cbhencodingkit
An easy-to-use category for `NSData` and `NSString` to encode data in Base64 andBase32.
https://github.com/chris-huxtable/cbhencodingkit
base32 base64 objective-c objective-c-library
Last synced: about 1 year ago
JSON representation
An easy-to-use category for `NSData` and `NSString` to encode data in Base64 andBase32.
- Host: GitHub
- URL: https://github.com/chris-huxtable/cbhencodingkit
- Owner: chris-huxtable
- License: isc
- Created: 2019-03-05T14:56:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-12-05T07:34:41.000Z (over 6 years ago)
- Last Synced: 2025-03-11T11:17:22.731Z (over 1 year ago)
- Topics: base32, base64, objective-c, objective-c-library
- Language: Objective-C
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CBHEncodingKit
[](https://github.com/chris-huxtable/CBHEncodingKit/releases)
[](https://cocoapods.org/pods/CBHEncodingKit)
[](https://github.com/chris-huxtable/CBHEncodingKit/blob/master/LICENSE)
[](https://github.com/chris-huxtable/CBHEncodingKit)
An easy to use category for `NSData` and `NSString` to encode data.
Supports:
- Base32
- Base64
## Use
`CBHEncodingKit` extends `NSData` and `NSString` with a category; adding methods for several encoding types.
#### Examples:
Encode `NSData` using Base64:
```objective-c
NSData *data = /* some data */
NSString *base64 = [data encodeBase64];
```
Decode `NSData` encoded in Base64:
```objective-c
NSString *base64 = /* some base64 encoded string */
NSData *data = [base64 decodeBase64];
```
Encode `NSString` using Base64:
```objective-c
NSString *string = @"some string"
NSString *base64 = [string encodeBase64];
```
Decode `NSString` encoded in Base64:
```objective-c
NSString *base64 = /* some base64 encoded string */
NSString *string = [NSString stringByDecodingBase64String];
```
## Licence
CBHEncodingKit is available under the [ISC license](https://github.com/chris-huxtable/CBHEncodingKit/blob/master/LICENSE).