Quote:
Originally Posted by aryaxt
I am getting Base64 encoded text from the server.
I need to decode it
"KG9ic2VydmVyKSBoZWxsbw=="
which should be decoded to
"(observer) hello"
Can somebody tell me how I should decode and encode base64? I searched it on google i found nothing. I don't even need the code. I just need to know the logic, and i'll wirte the code myself.
Is there any library in the sdk that allows me to do this?
|
There's a category (an extension to a class) for base64 encoding at the bottom of this page:
CocoaDev: BaseSixtyFour
If you use it, you can decode any string with
NSData* mydata = [NSData dataWithBase64EncodedString: yourString];
I've tried it, it works.