Creating a base-64 string from NSData

2019-01-18 14:06发布

How is it possible to get a base64 string from an NSData instance?

3条回答
劳资没心,怎么记你
2楼-- · 2019-01-18 14:26
NSString* base64String = [nsdata base64Encoding];
查看更多
劫难
3楼-- · 2019-01-18 14:31

please try to search before posting questions I already post a answer for this here - Verifying a Receipt with the App Store - try this function there.

查看更多
Bombasti
4楼-- · 2019-01-18 14:40

(if you targeting on IOS 7 ...) There is an easy way using provided API: https://stackoverflow.com/a/19088341/2481444

I also tested the accepted code. They both generate the same result.

It also has decoding function. @S.J

查看更多
登录 后发表回答