Base64 Encode and decode
i need to encode some string(like UID,PWD) using Base64 in objective C how can i do it. can anybody share the 开发者_运维知识库code.
Thanks in advance
I am using the xmppframework library for my iphone project, and there are these two NSData Categories that take care of encoding(decoding) to(from) base64.
NSDataAdditions.h
NSDataAdditions.m
You should be able to use this category in your project.
While Sailesh's answer is probably the easiest way, Apple also provides some (more low level) example code in the "Security Transforms Programming Guide".
https://developer.apple.com/library/mac/#documentation/Security/Conceptual/SecTransformPG/SecurityTransformsBasics/SecurityTransformsBasics.html
However this is only available in Mac OS 10.7 or higher.
精彩评论